<?php
/**
 * Author: yixuan
 * Desc:
 * Time: 2016/6/8 13:32
 */

if (!function_exists('format_text')) {
    function format_text($txt)
    {
        $txt = stripcslashes(filterEmoji(trim($txt)));
        $txt = str_replace('<', "＜", $txt);
        $txt = str_replace('>', "＞", $txt);

        $txt = convertQuotToChinese($txt, '"', "“ ", "” ");
        $txt = convertQuotToChinese($txt, "'", "‘", "’");

        return xhtmlspecialchars($txt);
    }
}

if (!function_exists('convertQuotToChinese')) {
    function convertQuotToChinese($string, $old, $left, $right)
    {
        $flag = false; //false显示开始的中文引号,true时显示结束的中文引号
        while (false !== ($i = strpos($string, $old))) {
            $begin_string = substr($string, 0, $i);
            $end_i = $i + 1 - strlen($string);
            if ($end_i < 0) {
                $end_string = substr($string, $end_i);
            } else {
                $end_string = '';
            }
            $quot = $flag ? $right : $left;
            $flag = !$flag;
            $string = $begin_string . $quot . $end_string;
        }
        return $string;
    }
}
if (!function_exists('get_path')) {
    function get_path($file)
    {
        $path = PATH_MODULE . $file;
        if (!is_file($path)) {
            $path = PUBLIC_PATH . $file;
        }
        return $path;
    }
}
if (!function_exists('valuename')) {
    function valuename($key, $value, $name)
    {
        if (is_array($value)) {
            $realname = json_encode($value);
        } else {
            $realname = $name[$key][$value];
            if (empty($realname)) {
                $realname = false;
            }
        }
        return $realname;
    }
}
if (!function_exists('getValueArray')) {
    function getValueArray()
    {
        $name['autored'] = ['后台手工发放', '自动发放', '客户提现：达到设定金额可提现', '不可提现'];
        $name['send_mode'] = ['禁用', '启用：分帐', '启用：企业付款到零钱'];
        $name['teammax'] = ['20个团队', '30个团队', '50个团队'];
        $name['ischristmas'] = ['禁用', '圣诞树+菜单', '菜单'];
        $name['h5work'] = ['老版本', '新版本'];
        $name['tixing'] = ['', '易宣平台', '禁用', '客户公众号'];
        $name['selecet_pay'] = ['禁用', '启用'];
        $name['selling_agent'] = ['禁用', '启用'];
        $name['isdianliang'] = ['禁用', '启用'];
        $name['isform'] = ['禁用', '启用'];
        $name['fenxiao08'] = ['禁用', '启用'];
        $name['fenxiao071'] = ['禁用', '启用'];
        $name['noticeopen'] = ['禁用', '启用'];
        $name['qrlist'] = ['禁用', '启用'];
        $name['ispresale'] = ['禁用', '启用'];
        $name['isform'] = ['禁用', '启用'];
        $name['daiyan'] = ['禁用', '启用'];
        $name['lottery'] = ['禁用', '启用'];
        $name['mulit_products'] = ['禁用', '启用'];
        $name['redrain'] = ['禁用', '抵扣', '提现'];
        $name['is_shop_plan'] = ['禁用', '启用'];
        $name['beilai_style'] = ['禁用', '启用'];
        $name['isheadposter'] = ['禁用', '启用'];
        $name['video_button'] = ['默认居中', '自定义左右位置'];
        $name['tuijianren'] = ['禁用', '仅易宣工作人员', '客户电脑版后台'];
        $name['open_danmu_btn'] = ['禁用', '开启'];
        $name['is_mystery_boxes'] = ['禁用', '开启'];
        $name['qrlistbufa'] = ['开启', '关闭'];
        $name['friendsuccessid'] = ['开启', '关闭'];
        $name['refund_limit_ip'] = ['开启，需员工确认', '关闭', '开启，扫码直接退'];
        $name['refund_limit_worker'] = ['仅管理员可退', '仅管理员可退，员工不显示退款按扭', '员工可退'];
        $name['isgifthexiao'] = ['关闭', '开启'];
        $name['isduoxuan'] = ['关闭', '开启'];
        $name['shopstype5'] = ['关闭', '开启'];
        $name['mystery_is_preview'] = ['关闭', '开启'];
        $name['qrlistbufa'] = ['付款发放', '拼团成功发放'];
        $name['softsn_status'] = ['无冲突', '专版待确认', '专版借用待审核', '专版误报待审核', '专版借用未通过', '专版误报审核未通过'];
        $name['banmian'] = ['可外发', '不可外发'];
        $name['softqubanquan'] = ['未开启', '开启去版权'];
        $name['softoem'] = ['未开启', '开启OEM'];

        $name['my_info'] = ['未开启', '开启', '开启', '开启'];
        $name['my_info_friend'] = ['未开启', '开启'];
        $name['my_info_record'] = ['未开启', '开启'];
        $name['my_info_fans'] = ['未开启', '开启'];
        $name['my_info_rank'] = ['当前排名', '分享次数', '关闭'];
        $name['my_info_show'] = ['', '顶部显示', '中间显示', '独立页面'];
        $name['my_info_user'] = ['所有', '报名用户', '仅限团长'];
        $name['rank_user_type_new'] = ['所有', '报名用户', '仅限团长'];

        $name['profit_sharing_split'] = ['关闭', '30%用原定单，剩余用定单发放', '30%用原定单，剩余优先使用充值的钱'];
        $name['profit_sharing_comm2'] = ['正常模式', '优先使用充值的钱'];
        $name['profit_sharing_comm3'] = ['正常模式', '优先使用充值的钱'];
        $name['profit_sharing_comm5'] = ['正常模式', '优先使用充值的钱'];

        $name['rank_show'] = ['底部显示（默认）', '顶部显示', '中间显示', '独立页面'];
        $name['rank_show_new'] = ['底部显示（默认）', '顶部显示', '中间显示', '独立页面'];
        $name['rank_user_type'] = ['所有', '报名用户', '仅限团长'];
        $name['rank_user_type_new'] = ['所有', '报名用户', '仅限团长'];
        $name['rank_order'] = ['未开启', '团长排名', '助力排名', '粉丝推荐成交量', '粉丝推荐新粉量'];
        $name['rank_order_new'] = ['未开启', '团长排名', '助力排名', '粉丝推荐成交量', '粉丝推荐新粉量'];
        $name['rank_show_tuan'] = ['显示', '不显示'];
        $name['isrankrenshu'] = ['显示', '不显示'];
        $name['ishbicon'] = ['显示', '不显示'];
        $name['isrankqianshu'] = ['显示', '不显示'];
        $name['danmu05'] = ['显示', '不显示'];
        $name['jince_time_title'] = ['显示', '不显示'];
        $name['rank_sort_tuan'] = ['按最后一个团员报名时间', '按团长报名时间'];
        $name['car_order_list'] = ['不开启', '开启'];
        $name['new_order_show'] = ['未开启', '顶部显示', '中间显示', '独立页面'];
        $name['fcfootmenu'] = ['老样式', '新样式'];
        $name['fcfootmenu'] = ['老样式', '新样式'];
        $name['video_show_mode'] = ['全屏播放', '正常'];
        $name['weixinh5'] = ['仅限微信', '不限制'];
        $name['iscomplaint'] = ['支付凭证页显示', '首页显示', '支付凭证页+首页显示'];
        $name['iconlimituser'] = ['所有', '授权头像', '授权电话', '授权头像+电话'];
        $name['is_tuan_order'] = ['不可协助', '协助拼团'];
        $name['formtextleftopen'] = ['关闭', '开启'];
        $name['formtextleftopen'] = ['正常模式（我要开团，加入TA的团）', '一键拼团，团满后显示我要开团'];
        $name['isshow_end_footermenu'] = ['显示结束', '正常显示报名时再提示结束'];
        $name['is_input_wxchat'] = ['截屏二维码添客服', '复制wxid添加客服'];
        $name['is_view_edit_log'] = ['不可查看', '可查看'];
        $name['is_view_lottery_record'] = ['全员可查看', '仅管理员查看'];
        $name['orderConfirmationTransfer'] = ['禁用', '启用'];
        $name['is_view_user_log'] = ['全员可查看', '仅管理员查看'];
        $name['is_view_user_log'][-1] = '不可查看';
        $name['examplestyle'] = ['系统红包', '客户支付凭证'];
        $name['newgroup'] = ['默认', '原团未满，团员保留原团身份，可开新团当团长', '原团已满，团员保留原团身份，可开新团当团长', '原团未满，团员保留原团身份，自动成为团长', '原团已满，团员保留原团身份，自动成为团长'];
        $name['shopsort'] = ['未开启', '按客户选择量', '按客户流览量'];
        $name['yukuanfenxiao'] = ['正常分销', '报名有分销补款无分销', '报名无分销补款有分销红包'];
        $name['renshumode'] = ['达到多少人享受优惠，达到人数还可报名', '限购剩余多少，剩余为0活动结束', '达到多少人享受优惠，达到人数活动结束'];
        $name['daping_xuni'] = ['显示虚拟定单', '不显示'];
        $name['admin_show_touping'] = ['可以查看', '不可查看'];
        $name['xianxia_chongfu'] = ['同名同手机号不允许重复录入', '允许'];
        $name['menuclose'] = ['正常显示', '关闭底部按扭，只显客服信息', '关闭底部按扭，什么也不显示'];
        $name['presaledaping'] = ['统计所有', '只统计补款定单（只支持0点0分）'];
        $name['ad_style'] = ['老模式', '新模式'];
        $name['pageshare'] = ['分享+海报', '直接显示海报', '分享朋友圈文字+海报', '分享朋友圈文字(黑金)'];
        $name['address_type'] = ['所有', '第一个盲盒', '第二个盲盒', '第三个盲盒'];
        $name['poster_size'] = ['标准（1080*1701）', '大屏（1080*2160)', '全屏（1080*2330)'];
        $name['getavatar'] = ['不采集', '底部按扭获取(推荐)', '弹窗登录获取'];
        $name['getmobile'] = ['不采集', '底部按扭获取', '弹窗登录获取(推荐)', '全屏登录获取', '借用授权'];
        $name['auto_settlement'] = ['自动结算', '手动结算'];
        $name['ismycomm'] = ['默认：排行榜底部+有红包才显示', '排行榜底部+没红包也显示', '首图底部+没红包也显示'];
        $name['myredbagstyle'] = ['2019版样式', '2020新版样式', '2022新版样式'];
        $name['fenxiaourl'] = ['显示分享提示', '进入我的红包', '生成海报'];
        $name['fenxiao06_hpopen'] = ['自动发放', '手工提现'];
        $name['fenxiao01_hpopen'] = ['手工提现', '自动发放'];
        $name['refresh_other_num'] = ['补发1次', '不限次数'];
        $name['hbtixianmode'] = ['仅限第一次提现', '每次提现都限'];
        $name['hbtixianmode'] = ['微信红包', '个性红包'];
        $name['get_mystery_boxes'] = ['', '拼团成功', '未支付', '已支付'];
        $name['workerpass_mode'] = ['免密注册', '常规注册'];

        $name['open_yx_sms'] = ['关闭', '开启'];
        $name['sms_bargain_help'] = ['关闭', '开启'];
        $name['sms_bargain_success'] = ['关闭', '开启'];
        $name['sms_bargain_fail'] = ['关闭', '开启'];
        $name['sms_fenxiao01'] = ['关闭', '开启'];
        $name['sms_fenxiao02'] = ['关闭', '开启'];
        $name['sms_fenxiao03'] = ['关闭', '开启'];
        $name['sms_fenxiao05'] = ['关闭', '开启'];
        $name['sms_fenxiao06'] = ['关闭', '开启'];
        $name['sms_comm_agent'] = ['关闭', '开启'];
        $name['sms_fenxiao08'] = ['关闭', '开启'];
        $name['sms_self_buy'] = ['关闭', '开启'];
        $name['sms_friend_buy'] = ['关闭', '开启'];
        $name['sms_friend_help'] = ['关闭', '开启'];
        $name['sms_friend_help_success'] = ['关闭', '开启'];
        $name['sms_friend_newfans'] = ['关闭', '开启'];
        $name['sms_lottery_new'] = ['关闭', '开启'];
        $name['sms_mystery_boxes_new'] = ['关闭', '开启'];
        $name['sms_pintuan_new'] = ['关闭', '开启'];
        $name['sms_pintuan_success'] = ['关闭', '开启'];
        $name['sms_presale'] = ['关闭', '开启'];
        $name['sms_worker'] = ['关闭', '开启'];


        $name['mbxx_mode']['submit'] = "点击立即支付按扭";
        $name['mbxx_mode']['bottom'] = "点击底部按扭";
        $name['mbxx_mode']['pay'] = "支付成功";

        $name['address_status'][0] = "上架";
        $name['address_status'][1] = "下架";
        $name['gongzhong'][0] = "易宣公众平台";
        $name['gongzhong'][1] = "客户公众平台";
        $name['domainpingbi1'][0] = "未屏蔽";
        $name['domainpingbi1'][1] = "已屏蔽";
        $name['domainpingbi2'][0] = "未屏蔽";
        $name['domainpingbi2'][1] = "已屏蔽";
        $name['domainpingbi3'][0] = "未屏蔽";
        $name['domainpingbi3'][1] = "已屏蔽";
        $name['ruanjian'][0] = "拼团2019版";
        $name['ruanjian'][4] = "拼团2个团";
        $name['ruanjian'][1] = "微团";
        $name['ruanjian'][2] = "拼团2020版";
        $name['ruanjian'][3] = "异业联盟";
        $name['ruanjian'][5] = "砍价";

        $name['softstyle'][0] = "默认";
        $name['softstyle'][1] = "拼团:海轮";
        $name['softstyle'][3] = "拼团:五卡";
        $name['softstyle'][5] = "拼团:全国加盟";
        $name['softstyle'][101] = "异业:默认";
        $name['softstyle'][102] = "异业:立剑";
        $name['softstyle'][106] = "异业:立剑多商家";
        $name['softstyle'][108] = "异业:贝莱";
        $name['softstyle'][109] = "异业:教培专用";
        $name['softstyle'][8] = "拼团:蜗牛文化";
        $name['yx_lt_receive_con'][0] = "抽奖前";
        $name['yx_lt_receive_con'][1] = "抽奖后";


        $name['is_multiple_merchants'][0] = "禁用";
        $name['is_multiple_merchants'][1] = "启用";

        $name['fenxiao'][0] = "禁用";
        $name['fenxiao'][1] = "启用";

        $name['fenxiao01'][0] = "禁用分销";
        $name['fenxiao01'][1] = "一级分销";
        $name['fenxiao01'][2] = "二级分销";
        $name['fenxiao01'][3] = "三级分销";
        $name['fenxiao04'][0] = "禁用";
        $name['fenxiao04'][1] = "启用";
        $name['fenxiao05'][0] = "禁用";
        $name['fenxiao05'][1] = "启用";
        $name['fenxiao06'][0] = "禁用";
        $name['fenxiao06'][1] = "启用";
        $name['fenxiao07'][0] = "禁用";
        $name['fenxiao07'][1] = "启用";

        $name['jiage'][0] = "1个价格（默认）";
        $name['jiage'][1] = "2个价格";
        $name['jiage'][2] = "3个价格";


        $name['gift'][0] = "禁用";
        $name['gift'][1] = "启用";
        $name['friend'][0] = "禁用";
        $name['friend'][1] = "启用";
        $name['fanpai'][0] = "禁用";
        $name['fanpai'][1] = "启用";

        $name['tuwen'][0] = "自动";
        $name['tuwen'][1] = "永久可编辑";


        $name['status'][0] = "暂停";
        $name['status'][1] = "启用";
        $name['status'][2] = "结束";
        $name['tuanmode'][0] = "正常拼团";
        $name['tuanmode'][1] = "无限成团,团满依旧可以加入";
        $name['tuanmode'][2] = "团满后才可开新团";
        $name['tuanmode'][3] = "团满后才可开新团,团满依旧可以加入";

        $name['touxiang'][0] = "打开的客户";
        $name['touxiang'][1] = "填写姓名电话的";
        $name['touxiang'][2] = "支付的客户";


        $name['isrecent'][0] = "关闭";
        $name['isrecent'][1] = "开启：按报名顺序显示";
        $name['isrecent'][2] = "开启：随机显示";
        $name['isrecent'][3] = "开启：当前团显示在第一其它按团人数排序";
        $name['issearch'][0] = "关闭";
        $name['issearch'][1] = "开启";
        $name['automusic'][0] = "暂停";
        $name['automusic'][1] = "启用";


        $name['isicon'][0] = "关闭";
        $name['isicon'][1] = "转发朋友圈点亮";
        $name['isicon'][2] = "朋友阅读点亮";
        $name['isicon'][3] = "邀请好友点亮";

        $name['iconziliao'][0] = "收集";
        $name['iconziliao'][1] = "不收集";

        $name['iconlogo'][0] = "默认";
        $name['iconlogo'][1] = "商家logo";

        $name['iconhang'][0] = "自动";
        $name['iconhang'][28] = "3";
        $name['iconhang'][21] = "4";
        $name['iconhang'][16] = "5";
        $name['iconhang'][13] = "6";
        $name['iconhang'][11] = "7";
        $name['iconhang'][9] = "8";
        $name['iconhang'][7] = "9";
        $name['iconhang'][6] = "10";
        $name['iconhang'][5] = "12";
        $name['iconhang'][3] = "16";

        $name['friendorder'][0] = "已支付客户";
        $name['friendorder'][1] = "未支付+已支付";

        $name['iscomm'][0] = "暂停";
        $name['iscomm'][1] = "开启";

        $name['comm_avatar_user'][0] = "不可发放红包";
        $name['comm_avatar_user'][1] = "只有裂变红包正常发放";
        $name['comm_avatar_user'][2] = "所有分销正常发放";

        $name['iscommshow'][0] = "不显示";
        $name['iscommshow'][1] = "顶部显示";
        $name['iscommshow'][2] = "中间显示";
        $name['iscommshow'][3] = "底部显示";

        $name['iscommshow24'][0] = "暂停";
        $name['iscommshow24'][1] = "开启";

        $name['iscommshow_more'][0] = "可加载100条";
        $name['iscommshow_more'][1] = "不可加载更多";

        $name['iscommshowworker'][0] = "包含内部员工及代理";
        $name['iscommshowworker'][1] = "不包含";
        $name['iscommshowworker'][2] = "包含代理无员工";

        $name['isfansrankshowworker'][0] = "包含内部员工";
        $name['isfansrankshowworker'][1] = "不包含";

        $name['iscommshowfail'][0] = "不显示";
        $name['iscommshowfail'][1] = "显示";


        $name['commworker'][0] = "有";
        $name['commworker'][1] = "没有";

        $name['is_comm6_agent'][0] = "非直卖有提成";
        $name['is_comm6_agent'][1] = "非直卖无提成";

        $name['selling_agent_kefu'][0] = "显示员工的";
        $name['selling_agent_kefu'][1] = "显示代理的";

        $name['is_comm6'][0] = "直卖有提成";
        $name['is_comm6'][1] = "直卖无提成";
        $name['is_comm6'][2] = "非直卖无提成";

        $name['comm6_mode'][0] = "正常";
        $name['comm6_mode'][1] = "按所属团队设置";
        $name['comm6_mode'][2] = "按成交单数设置";

        $name['intheme'][0] = "所有";
        $name['intheme'][1] = "已支付的客户(员工不支付也可收到)";
        $name['intheme'][2] = "员工或代理（所有客户收不到）";

        $name['isfreeze'][0] = "不绑定";
        $name['isfreeze'][1] = "绑定";

        $name['comm4autored'][0] = "手工后台发放";
        $name['comm4autored'][1] = "系统自动发放";
        $name['comm4autored'][2] = "在下方时间之前自动发放";


        $name['comm4worker'][0] = "有";
        $name['comm4worker'][1] = "没有";

        $name['comm4dashuju'][0] = "开启【强烈推荐】";
        $name['comm4dashuju'][1] = "关闭";


        $name['comm4ispay'][0] = "所有";
        $name['comm4ispay'][1] = "已支付的客户";

        $name['iscommshowwait'][0] = "不显示";
        $name['iscommshowwait'][1] = "显示";


        $name['buttontyle'][0] = "自定义";
        $name['buttontyle'][1] = "经典蓝";
        $name['buttontyle'][2] = "拼多多红";
        $name['buttontyle'][3] = "京东红";

        $name['wtisshowmenu'][0] = "默认传统";
        $name['wtisshowmenu'][1] = "已报名*人";

        $name['isshowprice'][0] = "不显示";
        $name['isshowprice'][1] = "单买显示其它不显示";
        $name['isshowprice'][2] = "显示";

        $name['isshowtips'][0] = "显示";
        $name['isshowtips'][1] = "不显示";

        $name['isshow'][0] = "暂停";
        $name['isshow'][1] = "启用";


        $name['adshow'][0] = "居中大屏广告";
        $name['adshow'][1] = "底部横条广告";
        $name['adshow'][2] = "右下角浮标";


        $name['aduser'][0] = "所有用户出现";
        $name['aduser'][1] = "未付款用户出现";
        $name['aduser'][2] = "已付款用户出现";


        $name['fanpaifanwei'][0] = "报名客户";
        $name['fanpaifanwei'][1] = "未报名+报名客户";

        $name['fanpaijilu'][0] = "显示";
        $name['fanpaijilu'][1] = "不显示";


        $name['fanpaipengyouquan'][0] = "报名客户";
        $name['fanpaipengyouquan'][1] = "未报名+报名客户";

        $name['isshowkefu'][0] = "关闭";
        $name['isshowkefu'][1] = "开启";

        $name['iscode'][0] = "关闭";
        $name['iscode'][1] = "开启";

        $name['typeid'][0] = "任选";
        $name['typeid'][1] = "商城";

        $name['showgift'][0] = "活动内容上方";
        $name['showgift'][1] = "活动内容下方";

        $name['iseditorder'][0] = "不可修改";
        $name['iseditorder'][1] = "可修改";

        $name['iseditgroup'][0] = "不可修改";
        $name['iseditgroup'][1] = "可修改";

        $name['isreport'][0] = "不可查看";
        $name['isreport'][1] = "可查看";

        $name['isrank'][0] = "不可查看";
        $name['isrank'][1] = "可查看";

        $name['isshoprank'][0] = "不可查看";
        $name['isshoprank'][1] = "可查看";

        $name['isxianxia'][0] = "不可录入";
        $name['isxianxia'][1] = "可录入可删除";
        $name['isxianxia'][2] = "可录入不可删除";

        $name['isshowxianxia'][0] = "不可修改";
        $name['isshowxianxia'][1] = "可修改";


        $name['isexampleqr'][0] = "不显示";
        $name['isexampleqr'][1] = "显示";

        $name['isworkerpay'][0] = "不可支付";
        $name['isworkerpay'][1] = "可支付";

        $name['ishexiao'][0] = "关闭";
        $name['ishexiao'][1] = "开启";


        $name['showalldata'][0] = "不显示";
        $name['showalldata'][1] = "显示";

        $name['homeshowshop'][0] = "谁转发谁在前+手工排名";
        $name['homeshowshop'][1] = "谁转发谁在前+销售量排名";

        $name['duoshangjiashouye'][0] = "LOGO+首图";
        $name['duoshangjiashouye'][1] = "首图";


        $name['isautorefund'][0] = "不退款";
        $name['isautorefund'][1] = "开启自动退款";


        $name['showalldata'][0] = "不显示";
        $name['showalldata'][1] = "显示";


        $name['isdanmu'][0] = "关闭";
        $name['isdanmu'][1] = "新样式";
        $name['isdanmu'][2] = "老样式";


        $name['danmu01'][0] = "显示";
        $name['danmu01'][1] = "不显示";

        $name['danmu02'][0] = "显示最新+累计";
        $name['danmu02'][1] = "全不显示";
        $name['danmu02'][2] = "显示最新+累计+员工不显示";
        $name['danmu02'][3] = "显示最新+不显累计";
        $name['danmu02'][4] = "显示最新+不显累计+员工不显示";

        $name['danmu03'][0] = "显示";
        $name['danmu03'][1] = "不显示";

        $name['danmu04'][0] = "显示";
        $name['danmu04'][1] = "不显示";

        $name['istime'][0] = "默认";
        $name['istime'][1] = "黑色倒计时";
        $name['istime'][10] = "不显示";


        $name['iswttouxiang'][0] = "显示";
        $name['iswttouxiang'][1] = "普通模式";
        $name['iswttouxiang'][10] = "不显示";

        $name['isshowname'][0] = "关闭";
        $name['isshowname'][1] = "开启";

        $name['showpayresult'][0] = "显示";
        $name['showpayresult'][1] = "不显示";

        $name['iswxshare'][0] = "未屏蔽";
        $name['iswxshare'][1] = "已屏蔽";

        $name['yixuanbanquan'][0] = "显示";
        $name['yixuanbanquan'][1] = "不显示";


        $name['wuxian'][0] = "关闭";
        $name['wuxian'][1] = "开启";
        //抽奖设置
        $name['type'][0] = "实物奖品";
        $name['type'][1] = "红包奖品";
        $name['default_type'][0] = "正常奖项";
        $name['default_type'][1] = "未中奖奖项";
        $name['default_type'][2] = "必中奖项";
//        $name['status'][0]="上架";
//        $name['status'][1]="下架";

        $name['level'][1] = "超级管理员";
        $name['level'][2] = "商家管理员";
        $name['level'][3] = "员工";
        $name['level'][4] = "代理";


        $name['endday'][0] = "默认：5天关闭分销功能 开启水印";
        $name['endday'][10] = "10天关闭分销功能 开启水印";
        $name['endday'][15] = "15天关闭分销功能 开启水印";
        $name['endday'][30] = "30天关闭分销功能 开启水印";
        $name['endday'][60] = "60天关闭分销功能 开启水印";
        $name['softmenu'] = ['默认', '盲盒', '妈妈宝盒', '飞驰盲盒', '代言'];
        $name['pn_wxapp'] = ['关闭', '禁用分享模式', '启用分享模式', '支付后才可分享模式'];
        $name['softmode'] = ['H5', '小程序', 'H5+小程序'];
        $name['wxapp_demo'] = ['禁用', '启用'];
        $name['live'] = ['禁用', '启用'];
        $name['live_lottery'] = ['禁用', '启用'];
        $name['ispoints'] = ['禁用', '启用'];
        $name['iskoi'] = ['禁用', '启用'];
        $name['is_lz_game'] = ['禁用', '启用'];
        $name['is_lz_chest'] = ['禁用', '启用'];
        $name['is_lz_comment'] = ['禁用', '启用'];
        $name['is_member_points'] = ['禁用', '启用'];
        $name['iswechatgroup'] = ['禁用', '启用'];
        $name['islottery'] = ['禁用', '启用'];
        $name['bargain_gift'] = ['禁用', '启用'];
        $name['is_multiple_bargain'] = ['禁用', '启用'];
        $name['isboxgift'] = ['禁用', '启用'];
        $name['wxapp_worker'] = ['小程序自身', '借用H5管理'];
        $name['only_stu_data_mode'] = ['客户选择或手机号在库内', '仅限在库里的'];
        $name['stu_time_mode'] = ['不限制', '限制哪天之前有效'];
        return $name;
    }
}
if (!function_exists('getKeynameArray')) {
    function getKeynameArray()
    {
        $name['isboxgift'] = "开宝箱礼品";
        $name['is_multiple_bargain'] = "多产品砍价";
        $name['bargain_gift'] = "砍价邀请好友有礼";
        $name['islottery'] = "大转盘抽奖";
        $name['wechatgroupmax'] = "群二维码展示数";
        $name['iswechatgroup'] = "群二维码";
        $name['is_member_points'] = "会员积分";
        $name['is_lz_comment'] = "拼团评论弹幕";
        $name['is_lz_chest'] = "新宝箱";
        $name['is_lz_game'] = "宝妈拼拼看";
        $name['iskoi'] = "五锦拼霸王";
        $name['ispoints'] = "积分赢豪礼";
        $name['wxapp'] = "小程序ID";
        $name['live_lottery'] = "直播抽奖功能";
        $name['live'] = "小程序直播功能";
        $name['wxapp_demo'] = "小程序演示案例";
        $name['wxapp_worker'] = "小程序管理后台";
        $name['softmode'] = "H5转小程序";
        $name['pn_wxapp'] = "H5转小程序";
        $name['auth_mp'] = "授权头像";
        $name['teammax'] = "团队设置";
        $name['softmenu'] = "小程序菜单";
        $name['is_shop_plan'] = "线上预约";
        $name['endday'] = "活动结束后";
        $name['video_button'] = "视频播放按扭";
        $name['isheadposter'] = "活动首图海报";
        $name['beilai_style'] = "贝莱样式功能2";
        $name['redrain'] = "红包雨";
        $name['lottery'] = "九宫格抽奖";
        $name['daiyan'] = "我要代言";
        $name['isform'] = "纯表单功能";
        $name['tixing'] = "员工成交提醒关注";
        $name['h5work'] = "H5手机管理后台";
        $name['worker_max'] = "最大员工注册数";
        $name['qrlist'] = "成交发送二维码";
        $name['selecet_pay'] = "多选支付";
        $name['ischristmas'] = "圣诞节主题";
        $name['isdianliang'] = "点亮图标";
        $name['isdianliang'] = "团队设置";
        $name['selling_agent'] = "客户代理";
        $name['send_mode'] = "是否启用红包";
        $name['fenxiao071'] = "摇一摇礼品";
        $name['fenxiao08'] = "额外红包";
        $name['fenxiao09'] = "团长红包";
        $name['tuijianren'] = "修改推荐人";
        $name['ispresale'] = "预售模式";
        $name['softsn_status'] = "专版状态";
        $name['addimgxcx'] = "底部二维码小程序";
        $name['headimg'] = "活动首图";
        $name['chongzhi'] = "充值提现";
        $name['banmian'] = "设计版";
        $name['fanscount'] = "粉丝统计";
        $name['recordcount'] = "定单统计";
        $name['ordercount'] = "成交额";
        $name['softqubanquan'] = "版权";
        $name['softoem'] = "OEM品牌";
        $name['qrimg_addworker'] = "员工注册码";
        $name['laoshi'] = "策划老师";
        $name['xiaoshou'] = "易宣销售";
        $name['kefu'] = "易宣客服";
        $name['tuan_tips'] = "易宣客服";
        $name['province'] = "省";
        $name['city'] = "市";
        $name['district'] = "县";
        $name['videotime'] = "视频时长";
        $name['indexurl'] = "H5网址";
        $name['dapingurl'] = "大屏网址";
        $name['addworkerurl'] = "员工注册网址";
        $name['indexurlxcx'] = "小程序网址";
        $name['addworkerurlxcx'] = "小程序注册员工网址";
        $name['mbxx_mode'] = "模版消息订阅位置";
        $name['bannervideo'] = "轮播视频";
        $name['bannerimgs'] = "轮播图";
        $name['videoimgs'] = "视频底图";
        $name['video_show_left'] = "视频底图显示位置";
        $name['adsize'] = "广告：尺寸大小";
        $name['isform'] = "纯表单功能";
        $name['whiteiplist'] = "IP白名单";
        $name['paytotheme'] = "支付后跳转其它活动";
        $name['userdata_reply'] = "客户追踪快捷回复";
        $name['time_bgcolor'] = "倒计时背景色";
        $name['submittxt'] = "提交按钮文字";
        $name['qr_img'] = "提交按钮文字";
        $name['iscode'] = "卡密设置";

        $name['my_info'] = "我的记录:";
        $name['my_info_friend'] = "我的记录:我的助力";
        $name['my_info_record'] = "我的记录:推荐成交记录";
        $name['my_info_fans'] = "我的记录:新粉丝记录";
        $name['my_info_show'] = "我的记录:显示位置";
        $name['my_info_rank'] = "我的记录:旁显数据";
        $name['my_info_user'] = "我的记录:显示用户群";
        $name['my_info_color'] = "我的记录:样式底色";
        $name['my_info_color2'] = "我的记录:样式浅色";
        $name['my_info_title_txt'] = "我的记录:标题文字";
        $name['my_info_but_txt'] = "我的记录:底部按扭文字";
        $name['my_info_img'] = "我的记录:福利介绍图";

        $name['rank_show'] = "排行榜:显示位置";
        $name['rank_user_type'] = "排行榜:显示用户群";
        $name['rank_user_type_new'] = "排行榜:显示用户群";
        $name['tuanrank_color'] = "排行榜:背景色";
        $name['tuanrank_color2'] = "排行榜:背景色浅色";
        $name['tuanrank_color_new'] = "排行榜:背景色";
        $name['tuanrank_color_new2'] = "排行榜:背景色浅色";
        $name['rank_view_txt'] = "排行榜:底部按扭文字";
        $name['rank_title_txt'] = "排行榜:标题文字";
        $name['rank_order'] = "排行榜:排序类目";
        $name['rank_order_new'] = "排行榜:排序类目";
        $name['rank_show_new'] = "排行榜:显示位置";
        $name['rank_top_img_new'] = "排行榜:顶图";
        $name['rank_top_img'] = "排行榜:顶图";
        $name['rank_top_imgs'] = "排行榜:顶部图片组";
        $name['rank_bottom_imgs'] = "排行榜:底部图片组";
        $name['rank_limit'] = "排行榜:显示前多少个";
        $name['rank_show_tuan'] = "排行榜:团人数";
        $name['rank_sort_tuan'] = "排行榜:排序方式";
        $name['mystery_boxs_rank_tips'] = "排行榜:提示文字";
        $name['mystery_boxs_rank_hight'] = "排行榜:提示高度";
        $name['car_order_list'] = "汽车行业最新报名榜";
        $name['new_order_show'] = "最新订单记录：显示位置";
        $name['new_order_title_txt'] = "最新订单记录：标题文字";
        $name['new_order_bgcolor'] = "最新订单记录：背景颜色";
        $name['new_order_txtcolor'] = "最新订单记录：文字颜色";
        $name['fcfootmenu'] = "飞驰底部按扭样式";
        $name['danmu05'] = "代理提成";
        $name['pinpailogo'] = "品牌LOGO";
        $name['mappoint'] = "店铺导航坐标";
        $name['qrlistbufa'] = "二维码：自动补发";
        $name['qrlistmode'] = "二维码：发放模式";
        $name['zhuandanimg'] = "支付凭证弹屏图";
        $name['viewcity'] = "链接限制地区访问：城市";
        $name['viewcitywhitelist'] = "链接限制地区访问：白名单";
        $name['iscomplaint'] = "投诉浮标";
        $name['video_show_mode'] = "视频播放模式";
        $name['submittxt'] = "提交按钮文字";
        $name['liveid'] = "直播间ID";
        $name['jince_time_title'] = "金策：倒计时标题";
        $name['jince_bgcolor_left'] = "金策多人参与底色：左侧+右侧底色";
        $name['jince_bgcolor_center'] = "金策多人参与底色：中间底色";
        $name['weixinh5'] = "H5访问方式";
        $name['iconlimituser'] = "阅读点亮_小程序用户限制";
        $name['iconnum_baoming'] = "报名获得图标数";
        $name['groupsum'] = "最大开团数量";
        $name['groupautotime'] = "组团限时(整数小时)";
        $name['is_tuan_order'] = "员工协助拼团";
        $name['formcolorcenter'] = "中间按扭颜色";
        $name['formcolorcentertext'] = "中间文字颜色";
        $name['formtextleftopen'] = "H5原价购买按扭";
        $name['new_group_type'] = "加入团模式";
        $name['fakelottery'] = "已中奖人数虚拟";
        $name['isshow_end_footermenu'] = "已中奖人数虚拟";
        $name['isgifthexiao'] = "礼品核销";
        $name['hexiaoname'] = "定单核销别名";
        $name['gifthexiaoname'] = "礼品核销别名";
        $name['duoxuantips'] = "多选保存提示";
        $name['isduoxuan'] = "多选保存";
        $name['joinshopimg'] = "我也加入联盟";
        $name['is_input_wxchat'] = "添加客服";
        $name['is_view_edit_log'] = "定单修改日志";
        $name['is_view_lottery_record'] = "中奖记录";
        $name['orderConfirmationTransfer'] = "转单确认";
        $name['is_view_user_log'] = "用户日志";
        $name['examplestyle'] = "交易凭证样式";
        $name['newgroup'] = "拼团模式";
        $name['newgroup_img'] = "团长福利图";
        $name['shopstype5'] = "商家多选";
        $name['shopsort'] = "商家排名";
        $name['yukuan'] = "补款金额";
        $name['yukuantime'] = "补款时间";
        $name['yukuanfenxiao'] = "补款分销";
        $name['renshumode'] = "限购模式";
        $name['renshudanwei'] = "限购单位";
        $name['renshutips'] = "限购提示";
        $name['daping_xuni'] = "投屏虚拟数";
        $name['admin_show_touping'] = "管理员查看投屏";
        $name['xianxia_chongfu'] = "线下重复录入";
        $name['friendsuccesstip'] = "好友点亮_成功点亮提示";
        $name['friendsuccessid'] = "好友点亮_唯一凭证";
        $name['menuclose'] = "底部按扭";
        $name['presaledaping'] = "投屏设置";
        $name['refund_limit_ip'] = "到店退款码";
        $name['refund_limit_worker'] = "投诉退款";
        $name['only_stu_data'] = "新老生资料库";
        $name['only_stu_data_mode'] = "新老生资料库限制模式";
        $name['stu_time_mode'] = "新老生时间限制模式";
        $name['stu_limit_time'] = "新老生时间限制";
        $name['only_old_stu'] = "一个团限一名";
        $name['only_old_stu_tips'] = "一个团限一名提示";
        $name['only_stu_tour_leader'] = "仅限谁开团";
        $name['only_stu_tour_leader_tips'] = "仅限谁开团提示";
        $name['only_stu_league_member'] = "仅限谁参团";
        $name['only_stu_league_member_tips'] = "仅限谁参团提示";
        $name['only_stu_sign_up'] = "谁不能报名";
        $name['only_stu_sign_up_tips'] = "谁不能报名提示";
        $name['only_stu_comm'] = "介绍谁没分销";
        $name['poster_size'] = "海报大小";
        $name['open_danmu_btn'] = "启用弹幕按钮开关";
        $name['ad_style'] = "弹屏广告模式";
        $name['pageshare'] = "分享样式";
        $name['pageshare_txt'] = "分享海报文字";
        $name['pageshare_title'] = "分享海报顶部图";
        $name['pageshare_topimg'] = "分享海报引导图";
        $name['boxgiftimg'] = "开宝箱：底图";
        $name['getavatar'] = "小程序头像";
        $name['getmobile'] = "小程序手机号";
        $name['formtextleftxcx'] = "小程序单独购买文字";
        $name['formtextcenterxcx'] = "小程序没有团报名按扭:发起拼团";
        $name['formtextcenter2xcx'] = "小程序没有团报名按扭:拼团②";
        $name['formtextcenter3xcx'] = "小程序没有团报名按扭:拼团③";
        $name['formtextcenternewxcx'] = "小程序有组团报名按扭:新开团";
        $name['formtextrightxcx'] = "小程序有组团报名按扭:加入团";
        $name['auto_settlement'] = "分帐是否自动结算";
        $name['isrankrenshu'] = "排行榜中人气值";
        $name['isrankqianshu'] = "排行榜中选择数";
        $name['ismycomm'] = "我的红包";
        $name['myredbagstyle'] = "我的红包样式";
        $name['commlistimgbg'] = "飞驰排行榜样式底图";
        $name['commlistbg1'] = "红包排行榜样式：底色";
        $name['commlistbg2'] = "红包排行榜样式：每行底色";
        $name['commlistbg3'] = "红包排行榜样式：顶图底色";
        $name['ishbicon'] = "右下角红包图标";
        $name['fenxiaourl'] = "右下角红包图标动作";
        $name['hbtip'] = "右下角红包图标";
        $name['fenxiao06_hpopen'] = "员工提成发放";
        $name['fenxiao01_hpopen'] = "分销发放";
        $name['refresh_other_num'] = "额外补发限制";


        $name['profit_sharing_split'] = "分账拆分模式";
        $name['profit_sharing_split_fee'] = "分账拆分最小金额";
        $name['profit_sharing_comm2'] = "分账二级分销";
        $name['profit_sharing_comm3'] = "分账三级分销";
        $name['profit_sharing_comm5'] = "分账裂变红包";

        $name['yx_lt_receive_con'] = "九宫格抽奖：客资收集";
        $name['is_multiple_merchants'] = "异业模式";
        $name['recent_only_old'] = "附近团只显示";
        $name['bg'] = "背景图片";
        $name['waittips'] = "等待信息";
        $name['data'] = "海报数据";

        $name['qrlistname1'] = "二维码说明1";
        $name['qrlistname2'] = "二维码说明2";
        $name['qrlistimgs'] = "二维码图片组";

        $name['softtag0'] = "软件行业标签";
        $name['softtag1'] = "软件主题标签";
        $name['softtag2'] = "软件节日标签";
        $name['keyword'] = "软件标签";
        $name['adminname'] = "操作员";
        $name['admintime'] = "操作时间";

        $name['adshownum'] = "广告：同一用户出现频次";
        $name['aduser'] = "广告：用户分烊";
        $name['adshow'] = "广告：显示位置";
        $name['adurl'] = "广告：弹屏超链";
        $name['adimg'] = "广告：广告图";
        $name['adbegintime'] = "广告：弹屏开始时间";
        $name['adendtime'] = "广告：弹屏结束时间";

        $name['gongzhong'] = "公众平台易宣/客户";
        $name['domainhead1'] = "分享+授权域名1";
        $name['domainhead2'] = "domainhead2";
        $name['domainhead3'] = "分享域名3";
        $name['domainpingbi1'] = "朋友圈已屏蔽1";
        $name['domainpingbi2'] = "朋友圈已屏蔽2";
        $name['domainpingbi3'] = "朋友圈已屏蔽3";
        $name['domainhead4'] = "不可用域名";
        $name['ruanjian'] = "软件模式";
        $name['softstyle'] = "链接样式";
        $name['fenxiao'] = "是否启用红包";
        $name['fenxiao01'] = "红包模式";
        $name['fenxiao04'] = "转发红包";
        $name['fenxiao05'] = "阅读红包";
        $name['fenxiao06'] = "员工提成";
        $name['fenxiao07'] = "摇一摇红包";
        $name['autored'] = "自动发放佣金红包";
        $name['adminpass'] = "添加超级管理员密码";
        $name['jiage'] = "支付价格";
        $name['gift'] = "选择礼物/商家";
        $name['friend'] = "邀请助力点赞送星星";
        $name['fanpai'] = "翻牌抽奖";
        $name['tuwen'] = "图文编辑";
        $name['tiaozhuanurl'] = "页面跳转";
        $name['domain'] = "服务器域名";


        $name['title'] = "活动主标题";
        $name['desc'] = "副标题";
        $name['begintime'] = "开始时间";
        $name['endtime'] = "结束时间";
        $name['status'] = "活动状态";
        $name['softsn'] = "软件激活码";
        $name['renshu'] = "活动限制人数";
        $name['groupprice'] = "拼团价";
        $name['primeprice'] = "单买价";
        $name['joinfee'] = "定金";
        $name['marketprice'] = "市场价";
        $name['groupprice2'] = "拼团价②";
        $name['groupprice3'] = "拼团价③";
        $name['duojiagetips'] = "定金描述";
        $name['joinname'] = "定金1名称";
        $name['joinname2'] = "定金2名称";
        $name['joinfee2'] = "定金2金额";
        $name['joinname3'] = "定金3名称";
        $name['joinfee3'] = "定金3金额";
        $name['maxcountall'] = "成团人数";
        $name['maxcountall2'] = "成团人数②";
        $name['maxcountall3'] = "成团人数③";
        $name['maxcountall4'] = "成团人数④";
        $name['maxcountall5'] = "成团人数⑤";
        $name['tuanmode'] = "拼团模式";
        $name['refundfee'] = "退款个数";
        $name['touxiang'] = "显示头像模式";
        $name['fakejoin'] = "虚拟报名人数";
        $name['faketuan'] = "虚拟参与人数";
        $name['fakescan'] = "虚拟浏览";
        $name['comm7num'] = "摇一摇虚拟人数";
        $name['comm7fee'] = "摇一摇虚拟钱数";
        $name['isrecent'] = "附近的团";
        $name['issearch'] = "快速搜索";
        $name['comm7num'] = "摇一摇虚拟人数";
        $name['headlogo'] = "活动主图";
        $name['centerimgs'] = "顶部图片组";
        $name['imgs'] = "裂变图片";
        $name['addimg'] = "地址电话图";
        $name['kfewm'] = "客服二维码";
        $name['automusic'] = "音乐自动播放";
        $name['musicsrc'] = "背景音乐";
        $name['jubf'] = "交易凭证:主办方";
        $name['mobile'] = "交易凭证:客服电话";
        $name['addresstxt'] = "交易凭证:地址";
        $name['zhuandantxt'] = "交易凭证:时间文字描述";
        $name['zhuandanbegintime'] = "交易凭证:转单开始时间";
        $name['zhuandanendtime'] = "交易凭证:转单结束时间";
        $name['zhuandantips'] = "交易凭证:活动说明";
        $name['isicon'] = "点亮模式";
        $name['iconziliao'] = "收集资料";
        $name['darkicon'] = "点亮图标:未点亮";
        $name['lighticon'] = "点亮图标:点亮";
        $name['iconlogo'] = "图标LOGO";
        $name['iconname'] = "点亮按扭文字";
        $name['iconname_menu'] = "好友点亮_底部帮TA点亮";
        $name['friend_join'] = "好友点亮_底部报名按扭";
        $name['iconnum'] = "图标个数";
        $name['todayicon'] = "每天可以点亮几颗";
        $name['iconhang'] = "一行几个星星";
        $name['iconnum2'] = "阅读点亮比例值";
        $name['iconlimit'] = "阅读点亮每日限制";
        $name['starbgcolor'] = "点亮背景颜色";
        $name['starbtcolor'] = "点亮按扭颜色";
        $name['startextcolor'] = "按扭文字颜色";
        $name['friendorder'] = "客户要求";
        $name['friend_success'] = "底部按扭-成功";
        $name['gifttip'] = "邀请提示";
        $name['sharetip'] = "分享提示";
        $name['icongift'] = "赠送奖品";
        $name['icongiftsum'] = "奖品库存";
        $name['limitcity'] = "限制城市";
        $name['url'] = "跳转URL";
        $name['iscomm'] = "分销红包总开关";
        $name['comm_avatar_user'] = "未授权用户";
        $name['iscommshow'] = "是否显示红包排行";
        $name['iscommshow24'] = "是否显示24小时红包排行";
        $name['iscommshow_more'] = "红包排行榜";
        $name['iscommshowworker'] = "排行榜中包含内部员工";
        $name['isfansrankshowworker'] = "推荐排行榜中包含内部员工";
        $name['iscommshowfail'] = "我的红包里提现失败明细";
        $name['comm61'] = "员工提成:小";
        $name['comm62'] = "员工提成:大";
        $name['comm_agent1'] = "代理提成:小";
        $name['comm_agent2'] = "代理提成:大";
        $name['comm61_agent'] = "员工有代理提成:小";
        $name['comm62_agent'] = "员工有代理提成:大";
        $name['selling_agent_kefu'] = "代理模式：联系客服";
        $name['selling_agent_begintime'] = "注册代理时间:开始时间";
        $name['selling_agent_endtime'] = "注册代理时间:结束时间";
        $name['commlistimg'] = "红包排行榜顶图";
        $name['fenxiaotip'] = "分销指示图标";
        $name['yaoyiyaotip'] = "摇一摇红包指示图";
        $name['commworker'] = "员工是否有分销红包";
        $name['is_comm6_agent'] = "代理提成规则";
        $name['is_comm6'] = "员工提成规则";
        $name['comm6_mode'] = "员工提成模式";
        $name['intheme'] = "分销要求是否支付";
        $name['isfreeze'] = "绑定上下级";
        $name['comm11'] = "一级分销红包:小①";
        $name['comm12'] = "一级分销红包:大①";
        $name['comm13'] = "一级分销红包概率①";
        $name['comm11_2'] = "一级分销红包:小②";
        $name['comm12_2'] = "一级分销红包:大②";
        $name['comm13_2'] = "一级分销红包概率②";
        $name['comm11_3'] = "一级分销红包:小③";
        $name['comm12_3'] = "一级分销红包:大③";

        $name['comm1'] = "一级参团红包:小";
        $name['comm2'] = "一级参团红包:大";
        $name['comm21'] = "二级分销红包:小①";
        $name['comm22'] = "二级分销红包:大①";
        $name['comm23'] = "二级分销红包概率①";
        $name['comm21_2'] = "二级分销红包:小②";
        $name['comm22_2'] = "二级分销红包:大②";

        $name['comm31'] = "三级分销红包:小①";
        $name['comm32'] = "三级分销红包:大①";
        $name['comm33'] = "三级分销红包概率①";
        $name['comm31_2'] = "三级分销红包:小②";
        $name['comm32_2'] = "三级分销红包:大②";

        $name['comm41'] = "转发红包金额:小①";
        $name['comm42'] = "转发红包金额:大①";
        $name['comm43'] = "转发红包概率①";
        $name['comm41_2'] = "转发红包金额:小②";
        $name['comm42_2'] = "转发红包金额:大②";
        $name['comm43_2'] = "转发红包概率②";
        $name['comm41_3'] = "转发红包金额:小③";
        $name['comm42_3'] = "转发红包金额:大③";
        $name['comm4autoredtime'] = "裂变红包发放模式_在下方时间之前自动发放";

        $name['comm4_time1'] = "裂变红包发放开始时间";
        $name['comm4_time2'] = "裂变红包发放结束时间";

        $name['comm51'] = "阅读红包金额:小①";
        $name['comm52'] = "阅读红包金额:大①";
        $name['comm53'] = "阅读红包概率①";
        $name['comm51_2'] = "阅读红包金额:小②";
        $name['comm52_2'] = "阅读红包金额:大②";
        $name['comm53_2'] = "阅读红包概率②";
        $name['comm51_3'] = "阅读红包金额:小③";
        $name['comm52_3'] = "阅读红包金额:大③";
        $name['comm5daynum'] = "阅读红包每人每天多少个";
        $name['comm5sum'] = "阅读红包每人总多少个";
        $name['hbtixian'] = "拆红包：提现限额";
        $name['hbtixianmode'] = "拆红包：提现模式";
        $name['hbopenfee1'] = "拆红包：进入链接获得：小";
        $name['hbopenfee2'] = "拆红包：进入链接获得：大";
        $name['hborderfee1'] = "拆红包：自已报名获得：小";
        $name['hborderfee2'] = "拆红包：自已报名获得：大";
        $name['hbopenstyle'] = "领取红包样式";
        $name['comm4zhanbi'] = "裂变红包占比";
        $name['get_mystery_boxes'] = "盲盒：获得盲盒条件";
        $name['mystery_is_preview'] = "盲盒：预览模式";
        $name['mystery_lump_sump'] = "盲盒:全款金额";
        $name['mystery_menu_view_boxs'] = "盲盒:查看我的盲盒进度";
        $name['mystery_page_avatar_size'] = "盲盒：页面中拼团成功头像大小";
        $name['mystery_page_avatar_height'] = "盲盒：页面中拼团成功头像高度";
        $name['mystery_page_avatar_color'] = "盲盒：页面中拼团成功昵称颜色";
        $name['mystery_page_lump_sump_text'] = "盲盒：页面中全款支付按扭文字";
        $name['mystery_page_lump_sump_height'] = "盲盒：页面中全款支付按扭高度";
        $name['mystery_page_lump_sump_color'] = "盲盒：页面中全款支付按扭颜色";
        $name['mystery_page_friend_text'] = "盲盒：页面中邀请好友";
        $name['mystery_page_friend_height'] = "盲盒：页面中邀请好友高度";
        $name['mystery_page_friend_color'] = "盲盒：页面中邀请好友按扭颜色";
        $name['mystery_page_friend_font_color'] = "盲盒：页面中邀请好友字体颜色";
        $name['mystery_show_time'] = "盲盒：延时弹出";
        $name['mystery_gift_num'] = "盲盒：礼品个数";
        $name['mystery_page_friend_color'] = "盲盒：礼品个数";
        $name['mystery_boxes_content_top'] = "盲盒：邀请好友上方图文";

        $name['wuxian'] = "无限次购买";

        $name['comm61_jiage2'] = "第二个价格员工提成:小";
        $name['comm62_jiage2'] = "第二个价格员工提成:大";
        $name['comm11_jiage2'] = "第二个价格一级开团红包:小";
        $name['comm12_jiage2'] = "第二个价格一级开团红包:大";
        $name['comm1_jiage2'] = "第二个价格一级参团红包:小";
        $name['comm2_jiage2'] = "第二个价格一级参团红包:大";
        $name['comm21_jiage2'] = "第二个价格二级分销红包:小";
        $name['comm22_jiage2'] = "第二个价格二级分销红包:大";
        $name['comm31_jiage2'] = "第二个价格三级分销红包:小";
        $name['comm32_jiage2'] = "第二个价格三级分销红包:大";

        $name['comm91'] = "团长红包:小";
        $name['comm92'] = "团长红包:大";
        $name['comm91_jiage2'] = "第二个价格团长红包:小";
        $name['comm92_jiage2'] = "第二个价格团长红包:大";
        $name['comm91_jiage3'] = "第三个价格团长红包:小";
        $name['comm92_jiage3'] = "第三个价格团长红包:大";

        $name['comm61_jiage3'] = "第三个价格员工提成:小";
        $name['comm62_jiage3'] = "第三个价格员工提成:大";
        $name['comm11_jiage3'] = "第三个价格一级开团红包:小";
        $name['comm12_jiage3'] = "第三个价格一级开团红包:大";
        $name['comm1_jiage3'] = "第三个价格一级参团红包:小";
        $name['comm2_jiage3'] = "第三个价格一级参团红包:大";
        $name['comm21_jiage3'] = "第三个价格二级分销红包:小";
        $name['comm22_jiage3'] = "第三个价格二级分销红包:大";
        $name['comm31_jiage3'] = "第三个价格三级分销红包:小";
        $name['comm32_jiage3'] = "第三个价格三级分销红包:大";

        $name['comm4autored'] = "裂变红包发放模式";
        $name['comm4tips'] = "裂变红包:手工发放提示";
        $name['comm4worker'] = "裂变红包:员工是否有裂变红包";
        $name['comm4dashuju'] = "裂变红包:是否开启大数据";

        $name['comm711'] = "摇一摇红包第一天:小";
        $name['comm712'] = "摇一摇红包第一天:大";
        $name['comm71type'] = "摇一摇红包第一天:模式";
        $name['comm721'] = "摇一摇红包第二天:小";
        $name['comm722'] = "摇一摇红包第二天:大";
        $name['comm72type'] = "摇一摇红包第二天:模式";
        $name['comm731'] = "摇一摇红包第三天:小";
        $name['comm732'] = "摇一摇红包第三天:大";
        $name['comm73type'] = "摇一摇红包第三天:模式";
        $name['comm741'] = "摇一摇红包第四天:小";
        $name['comm742'] = "摇一摇红包第四天:大";
        $name['comm74type'] = "摇一摇红包第四天:模式";
        $name['comm751'] = "摇一摇红包第五天:小";
        $name['comm752'] = "摇一摇红包第五天:大";
        $name['comm75type'] = "摇一摇红包第五天:模式";
        $name['lipinoptions'] = "摇一摇礼品";
        $name['comm4daynum'] = "裂变红包:每天多少个";
        $name['comm4sum'] = "裂变红包:总共多少个";
        $name['comm4type'] = "裂变红包:最近3小时成交少于多少单";
        $name['comm4typehb'] = "裂变红包:最近3小时红包大于收入多少元";
        $name['comm4typeyg'] = "裂变红包:员工异常自动锁定";
        $name['comm4time'] = "裂变红包:多次领取间隔分钟";
        $name['comm4sharetime'] = "裂变红包:多少秒后分享";
        $name['comm4yaotime'] = "裂变红包:多少秒后摇一摇";
        $name['comm4day'] = "裂变红包:每天预算";
        $name['comm4hour'] = "裂变红包:每小时预算";
        $name['comm4ip'] = "裂变红包:同1网络";
        $name['locationtype'] = "裂变红包:定位方式";
        $name['comm4city'] = "裂变红包:地区限制";
        $name['comm4ispay'] = "裂变红包:要求是否支付";
        $name['iscommshowwait'] = "裂变红包:我的红包里未到账明细";

        $name['jmbiemingwenzi'] = "全款加盟:别名";
        $name['jmdibuwenzi'] = "全款加盟:底部按扭文字";
        $name['jmzhifuwenzi'] = "全款加盟:支付按扭文字";
        $name['jmlablesuccess'] = "全款加盟:报名成功提示";
        $name['jmbiemingwenzi2'] = "定金加盟:别名";
        $name['jmdibuwenzi2'] = "定金加盟:底部按扭文字";
        $name['jmzhifuwenzi2'] = "定金加盟:支付按扭文字";
        $name['jmlablesuccess2'] = "定金加盟:报名成功提示";
        $name['jmlocktext'] = "加盟:锁定地区提示";
        $name['jmnumimg'] = "加盟:多少家加盟底图";
        $name['jmkefuimg'] = "加盟:底部客服图片";
        $name['jmcityimg'] = "加盟:确认选择城市下方图";
        $name['jmlogo'] = "加盟:表单上方LOGO";
        $name['jmcontent'] = "加盟规则";

        $name['wtformtextleft'] = "微团免费报名按扭文字";
        $name['wtformtextpay'] = "微团支付按扭文字";
        $name['wtlablesuccess'] = "微团报名成功提示";
        $name['wtisshowmenu'] = "微团底部按扭样式";
        $name['buttontyle'] = "底部按扭配色";
        $name['formcolorhead'] = "左侧按扭颜色";
        $name['formcolorlefttext'] = "左侧按扭文字颜色";
        $name['formcolortop'] = "右侧按扭颜色";
        $name['formcolorrighttext'] = "右侧按扭文字颜色";
        $name['formtextleft'] = "单独购买文字";
        $name['formtextcenter'] = "没有团报名按扭:发起拼团";
        $name['formtextcenter2'] = "没有团报名按扭:拼团②";
        $name['formtextcenter3'] = "没有团报名按扭:拼团③";
        $name['formtextcenternew'] = "有组团报名按扭:新开团";
        $name['formtextright'] = "有组团报名按扭:加入团";
        $name['isshowprice'] = "按扭显示价格模式";
        $name['formtextpay'] = "支付按扭文字";
        $name['buttontips'] = "底部按扭上方提示";
        $name['lableleadergs'] = "组团邀请好友";
        $name['lablegspy'] = "单买邀请好友";
        $name['lablesuccess'] = "组团成功";
        $name['isshowtips'] = "弹窗中提示";
        $name['dandutips'] = "弹窗中单独购买提示";
        $name['pintuantips'] = "弹窗中拼团购买提示";
        $name['pintuantips2'] = "弹窗中拼团购买提示②";

        $name['fanpaigroupid'] = "翻牌:抽奖分组";
        $name['fanpaifanwei'] = "翻牌:抽奖客户";
        $name['fanpaijilu'] = "翻牌:是否显示中奖记录";
        $name['fanpaiimg'] = "翻牌图片";
        $name['fanpaibgcolor'] = "翻牌背景颜色";
        $name['fanpailimit'] = "翻牌:抽奖机会上限";
        $name['fanpaiweibaoming'] = "翻牌:未报名可抽";
        $name['fanpaibaoming'] = "翻牌:成功报名加抽";
        $name['fanpaiyaoqing'] = "翻牌:邀请一位好友报名加抽";
        $name['fanpaipengyouquan'] = "翻牌:分享朋友圈加抽";
        $name['fanpai1day'] = "翻牌:第一天分享朋友圈加抽";
        $name['fanpai2day'] = "翻牌:第二天分享朋友圈加抽";
        $name['fanpai3day'] = "翻牌:第三天分享朋友圈加抽";

        $name['sharetitlexcx'] = "小程序未支付分享标题";
        $name['sharetitlexcx2'] = "小程序已支付分享标题";
        $name['shareimgxcx'] = "小程序分享主图";
        $name['sharetitle1'] = "未支付分享标题";
        $name['sharetitle2'] = "已支付分享标题";
        $name['isshowkefu'] = "标题中显示客服";
        $name['img'] = "分享图标";

        $name['nametext'] = "表单:姓名别名";
        $name['mobiletext'] = "表单:手机号别名";
        $name['datetime'] = "表单:①文本/日期";
        $name['datetimetype'] = "表单:①文本/日期模式";
        $name['address'] = "表单:②文本/选项";
        $name['addresstype'] = "表单:②文本/选项模式";
        $name['addressoptions'] = "表单:②文本/多选选项";
        $name['formtwo'] = "表单:③文本/选项";
        $name['formtwotype'] = "表单:③文本/选项模式";
        $name['formtwooptions'] = "表单:③文本/多选选项";
        $name['addinfo'] = "表单:④文本/日期";
        $name['addinfotype'] = "表单:④文本/日期模式";
        $name['shops'] = "表单:⑤文本/多选";
        $name['shopstype'] = "表单:⑤文本/多选模式";
        $name['options'] = "表单:⑤文本/多选选项";
        $name['shopsmin'] = "表单:多选配置-最少选几个";
        $name['shopsmax'] = "表单:多选配置-最多选几个";
        $name['gudingoptions'] = "表单:多选配置-固定选项";


        $name['xieyi'] = "表单:协议条款";
        $name['giftgroupid'] = "选择礼品/商家:选择分组";
        $name['typeid'] = "选择礼品/商家:支付模式";
        $name['gifttypesum'] = "选择礼品/商家:个数";
        $name['gifttypeselect1'] = "选择礼品/商家可选个数:小";
        $name['gifttypeselect2'] = "选择礼品/商家可选个数:大";
        $name['showgift'] = "选择礼品/商家:显示位置";

        $name['workerpass'] = "手机管理端设置:注册员工密码";
        $name['workerpass_mode'] = "手机管理端设置:注册密码";
        $name['iseditorder'] = "手机管理端设置:员工修改客户定单";
        $name['iseditgroup'] = "手机管理端设置:员工修改所属团";
        $name['isreport'] = "手机管理端设置:员工查团队日报";
        $name['isrank'] = "手机管理端设置:员工查团队排名";
        $name['isshoprank'] = "手机管理端设置:商家管理员查联盟商排名";
        $name['isxianxia'] = "手机管理端设置:线下录入";
        $name['isshowxianxia'] = "手机管理端设置:显示线下录入";
        $name['isexampleqr'] = "手机管理端设置:交易凭证二维码";

        $name['blacklist'] = "链接黑名单";
        $name['whitelist'] = "链接白名单";
        $name['isworkerpay'] = "员工可以支付";
        $name['ishexiao'] = "商家核销";
        $name['tuanrank'] = "团长排行榜";
        $name['fansrank'] = "粉丝推荐成交榜";
        $name['showalldata'] = "显示所有链接数据";
        $name['homeshowshop'] = "首页商家排序";
        $name['showshop'] = "活动主商家";
        $name['duoshangjiashouye'] = "多商家异业联盟首页";
        $name['duoshangjiaheigh'] = "多商家异业首页尺寸";
        $name['groupneedtime'] = "组团限时";
        $name['isautorefund'] = "组团失败是否退款";
        $name['uniacid'] = "公众平台变更";
        $name['isdanmu'] = "开启弹幕";
        $name['danmu01'] = "弹幕点亮图标";
        $name['danmu02'] = "弹幕分销红包";
        $name['danmu03'] = "弹幕员工提成";
        $name['danmu04'] = "弹幕裂变红包";
        $name['istime'] = "倒计时";
        $name['iswttouxiang'] = "报名数据+头像";
        $name['isshowname'] = "隐藏客户姓名";
        $name['showpayresult'] = "交易凭证";
        $name['iswxshare'] = "朋友圈被屏蔽";
        $name['payedurl'] = "支付后URL";
        $name['yixuanbanquan'] = "版权信息是否显示";
        $name['USERJISHU'] = "版权:链接底部提示信息";
        $name['USERURL'] = "版权:链接URL";
        $name['USERCOMPANYNAME'] = "版权:公司简称";

        //抽奖相关
        $name['lottery_title2'] = "奖品";
        $name['lottery_title'] = "奖品名称";
        $name['lottery_name'] = "奖项名称";
        $name['desc_content'] = "奖品介绍";
        $name['qty'] = "库存";
        $name['out_qty'] = "已抽出数量";
        $name['red_envelopes_day_qty'] = "每日红包发放数量";
        $name['red_envelopes_amount_min'] = "发放红包金额最小值";
        $name['red_envelopes_amount_max'] = "发放红包金额最大值";
        $name['pr'] = "中奖概率";
        $name['show_pr'] = "中奖记录占比";
        $name['show_sort'] = "奖品展示排序";
        $name['small_img'] = "奖品小图";

        $name['addressprobability'] = "盲盒礼品:中奖率";
        $name['addressstock'] = "盲盒礼品:库存";
        $name['address_status'] = "盲盒礼品:状态";
        $name['addressprice'] = "盲盒礼品:价值";
        $name['address_type'] = "盲盒礼品:第几个盲盒会抽中";
        $name['addressimg'] = "盲盒礼品:图片";

        $name['form2'] = "表单2";
        $name['form3'] = "表单3";


        $name['level'] = "身份";
        $name['company'] = "商家";
        $name['team'] = "团队";
        $name['qruserid'] = "代理上级";
        $name['nickname'] = "昵称";
        $name['avatar'] = "头像";
        $name['username'] = "用户名";
        $name['mobile'] = "手机号";
        $name['wechat'] = "微信名";
        $name['qrcode'] = "微信二维码";
        $name['is_mystery_boxes'] = "盲盒";
        $name['noticeopen'] = "模版消息";

        $name['open_yx_sms'] = '短信提提总开关';
        $name['sms_bargain_help'] = '短信:帮砍提醒';
        $name['sms_bargain_success'] = '短信:砍价成功';
        $name['sms_bargain_fail'] = '短信:砍价失败';
        $name['sms_fenxiao01'] = '短信:一级分销';
        $name['sms_fenxiao02'] = '短信:二级分销';
        $name['sms_fenxiao03'] = '短信:三级分销';
        $name['sms_fenxiao05'] = '短信:阅读红包';
        $name['sms_fenxiao06'] = '短信:员工提成';
        $name['sms_comm_agent'] = '短信:代理提成';
        $name['sms_fenxiao08'] = '短信:额外红包';
        $name['sms_friend_buy'] = '短信:好友购买';
        $name['sms_self_buy'] = '短信:客户支付成功';
        $name['sms_friend_help'] = '短信:好友助力';
        $name['sms_friend_help_success'] = '短信:好友助力成功';
        $name['sms_friend_newfans'] = '短信:好友到访';
        $name['sms_lottery_new'] = '短信:抽奖机会增加';
        $name['sms_mystery_boxes_new'] = '短信:新盲盒可拆';
        $name['sms_pintuan_new'] = '短信:新成员通知';
        $name['sms_pintuan_success'] = '短信:拼团成功';
        $name['sms_presale'] = '短信:预售补款通知';
        $name['sms_worker'] = '短信:员工通知';
        $name['sms_diy'] = '短信:自定义模版';
        $name['sms_user_pause'] = '短信:暂停短信通知';
        $name['sms_day_max'] = '短信:每日发放';
        $name['sms_hour_max'] = '短信:每小时发放';
        $name['sms_notice_signname'] = '短信:通知名称';
        $name['sms_senior'] = '高级群发';
        $name['sms_llfast'] = '快速群发';
        return $name;
    }
}
/**
 * 获取毫秒数\
 * @return number
 */
if (!function_exists('getMillisecond')) {
    function getMillisecond()
    {
        global $_G;
        list ($t1, $t2) = explode(' ', microtime());
        $basecode = ( float )sprintf('%.0f', (floatval($t1) + floatval($t2)) * 1000);
        $softid = substr(MODULE_NAME, -5);
        $uid = empty($_G['uid']) || $_G['uid'] < 10000 ? mt_rand(1000, 9999) : substr($_G['uid'], -4);
        $rand_txt = substr($basecode, 2, 5) . $uid . mt_rand(1000, 9999);
        return $softid . date("mdHis") . $rand_txt;
    }
}
if (!function_exists('filterEmoji')) {
    function filterEmoji($str)
    {
        $str = preg_replace_callback(
            '/./u',
            function (array $match) {
                return strlen($match[0]) >= 4 ? '' : $match[0];
            },
            $str);
        return $str;
    }
}
if (!function_exists('dump')) {
    function dump($var, $echo = true, $label = null, $strict = true)
    {
        $label = ($label === null) ? '' : rtrim($label) . ' ';
        if (!$strict) {
            if (ini_get('html_errors')) {
                $output = print_r($var, true);
                $output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) . "</pre>";
            } else {
                $output = $label . print_r($var, true);
            }
        } else {
            ob_start();
            var_dump($var);
            $output = ob_get_clean();
            if (!extension_loaded('xdebug')) {
                $output = preg_replace("/]=>(s+)/m", "] => ", $output);
                $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
            }
        }
        if ($echo) {
            echo($output);
            return null;
        } else
            return $output;
    }
}
if (!function_exists('timeConversion')) {
    function timeConversion($startdate, $enddate = '')
    {
        if (empty($enddate)) {
            $enddate = date('Y-m-d H:i:s', time());
        }
        $date = floor((strtotime($enddate) - strtotime($startdate)) / 86400);
        if ($date >= 1) {
            return $date . '天前';
        } else {
            if (substr($startdate, 0, 10) <> substr($enddate, 0, 10)) {
                return '昨天';
            }
        }

        $hour = floor((strtotime($enddate) - strtotime($startdate)) % 86400 / 3600);
        if ($hour > 0) {
            return $hour . '小时前';
        }
        $minute = floor((strtotime($enddate) - strtotime($startdate)) % 86400 / 60);
        if ($minute > 0) {
            return $minute . '分钟前';
        } else {
            return '刚刚';
        }
    }
}
if (!function_exists('formatTxtBySplit')) {
    function formatTxtBySplit($txt, $comma = ',')
    {
        $txt = str_replace(',', $comma, $txt);
        $txt = str_replace('，', $comma, $txt);
        $txt = str_replace('；', $comma, $txt);
        $txt = str_replace(';', $comma, $txt);
        $txt = str_replace('|', $comma, $txt);
        $txt = str_replace('|', $comma, $txt);
        return $txt;
    }
}
/**
 * Desc:获取支付状态及样式
 * 需传recordid,status,type,addtime,
 * $userlist 为已补款的用户的UID 在调用些方法前，需在循环外层加此段代码
 * if ($config['yukuan'] > 0 && TIMESTAMP > $config['yukuantime']) {
 * $userlist = Fans::getWeiBukuanList($config,$themeid);
 * }
 * @return $class $txt
 */
if (!function_exists('getPayStatus')) {
    function getPayStatus($config, $themeid, $userlist, $recordid, $status = 0, $addtime, $type, $isexport = false)
    {
        if ($status == 0) {
            $class = 'warning';
            $txt = '未支付';
        } elseif ($status == 1) {
            $class = 'success';
            $txt = '已支付';
        } elseif ($status == -1) {
            $class = 'danger';
            $txt = '已退款';
        } elseif ($status == -2) {
            $class = 'danger';
            $txt = '虚拟定单';
        } elseif ($status == 3) {
            $class = 'info';
            $txt = '线下定单';
        }
        if ($status == 1 || $status == 3) {
            if ($config['yukuan'] > 0 && TIMESTAMP > $config['yukuantime']) {
                if ($addtime < $config['yukuantime']) {
                    if (empty($userlist)) {
                        $userlist = \app\model\Fans::getWeiBukuanList($config, $themeid);
                    }
                    if (in_array($recordid, $userlist)) {
//                    $txt = $status==1?'线上未补':'线下未补';
                        $bukuan_class = 'warning';
                        $bukuan = '未补余款';
                    } else {
//                    $txt = $status==1?'线上已补':'线下已补';
                        $bukuan_class = 'success';
                        $bukuan = '已补余款';
                    }
                } else {
                    if ($type == 8) {
//                    $txt = $status==1?'线上补余款':'线下补余款';
                        $bukuan_class = 'success';
                        $bukuan = '补余款';
                    } else {
//                    $txt = $status==1?'线上全款':'线下全款';
                        $bukuan_class = 'info';
                        $bukuan = '全款支付';
                    }
                }

            }
        } elseif ($isexport) {
            $bukuan_class = $class;
            $bukuan = $txt;
        }
        return array('class' => $class, 'txt' => $txt, 'bukuan' => $bukuan, 'bukuan_class' => $bukuan_class);
    }
}
///**
// * Desc:复制微信请求类
// * @param $url
// * @param $post
// * @return mixed
// */
if (!function_exists('oa_request')) {
    function oa_request($url, $post = array())
    {
        if ($post) {
            $headers = array('Content-Type' => 'application/json;charset=UTF-8');
            $response = yxcurl($url, $post, true, $headers);
        } else {
            $response = yxcurl($url, true, $post);
        }
        $response = json_decode($response, true);
        if (empty($response) || !empty($response['errcode'])) {
            return ['error' => $response['errcode'], 'msg' => $response['errmsg']];
        }
        return $response;
    }
}
if (!function_exists('modelShow')) {
    //model通用化返回
    function modelShow($code, $msg = '', $data = [])
    {
        $msgList = getCodeMsgList($code);

        if (empty($msg) && array_key_exists($code, $msgList)) {
            $msg = $msgList[$code];
        }
        if (empty($msg) && !array_key_exists($code, $msgList)) {
            $msg = '发生了意外';
        }
        return ['code' => $code, 'msg' => $msg, 'data' => $data];
    }
}
if (!function_exists('filterEmptyData')) {
    function filterEmptyData($result)
    {
        foreach ($result as $k => $v) {
            if (is_array($v)) {
                $result[$k] = filterEmptyData($v);
            }
        }
        return $result;
    }
}
if (!function_exists('getCodeMsgList')) {
//返回信息状态码对应状态信息
    function getCodeMsgList()
    {
        $list = [
            200 => '操作成功',
            30000 => '操作失败',
            30001 => '到达操作数量上限',
            40000 => '发生了意外',
            40001 => '参数缺失',
            40002 => '活动入口不正确',
            40003 => '活动未设置配置信息',
            40010 => '抽奖次数不足，无法抽奖',
            40011 => '抽奖次数达到上限',
            40012 => '今日抽奖次数达到上限',
            40020 => '积分不足，无法兑换礼品',
            40029 => '开启了中奖后领取动作，必须设置次数',
            40030 => '抽奖活动未开启',
            40031 => '抽奖活动未开始',
            40032 => '抽奖活动已结束',
            40040 => '积分活动未开启',
            40041 => '积分活动未开始',
            40042 => '积分活动已结束',
            40050 => '获取群二维码失败',
            40060 => '砍价配置-价格设置不正确',//后台砍价参数检测
            40061 => '砍价配置-商品限购不合法',
            40062 => '砍价实例不存在',
            40063 => '拼团未开启',
            40064 => '活动未开始',
            40065 => '活动已结束',
            40066 => '砍价时间已到',
            40067 => '好友砍价已完成',
            40068 => '您已经帮好友砍价了',
            40069 => '达到好友帮砍上限',
            40070 => '砍价功能未开启',
            40071 => '好友帮砍设置',
            40072 => '后台砍价黄金宝刀未开启',
            40073 => '后台分享砍价未开启',
            40074 => '后台砍价翻倍未开启',
            40075 => '黄金宝刀已使用',
            40076 => '分享微信群已使用',
            40077 => '分享金额翻倍已使用',
            40078 => '无操作权限',
            40079 => '活动暂停',
            40080 => '抽奖总开关',
            50000 => '非法请求',
            60000 => '员工无法参与游戏'
        ];
        return $list;
    }
}
/**
 * 用户姓名保留两边 中间*
 */
if (!function_exists('substr_cut_username')) {
//用户姓名保留两边 中间*
    function substr_cut_username($user_name)
    {
        $strlen = mb_strlen($user_name, 'utf-8');
        if ($strlen < 2) {
            return '*' . $user_name;
        } else {
            //mb_substr — 获取字符串的部分
            $firstStr = mb_substr($user_name, 0, 1, 'utf-8');
            $lastStr = mb_substr($user_name, -1, 1, 'utf-8');
            //str_repeat — 重复一个字符串
            return $strlen == 2 ? $firstStr . str_repeat('*', mb_strlen($user_name, 'utf-8') - 1) : $firstStr . "*" . $lastStr;
        }
    }
}
/**
 * 手机号脱敏格式化
 */
if (!function_exists('substr_cut_mobile')) {
//    手机号脱敏格式化
    function substr_cut_mobile($mobile)
    {
        $firstStr = mb_substr($mobile, 0, 3, 'utf-8');
        $lastStr = substr($mobile, -4);
        return $firstStr . '****' . $lastStr;
    }
}
/**
 * 判断手机号格式
 */
if (!function_exists('CheckPhoneNumber')) {
    function CheckPhoneNumber($phone)
    {
        if (preg_match("/^1[3456789]{1}\d{9}$/", $phone)) {
            return true;
        } else {
            return false;
        }
    }
}
/**
 *随机产生兑换码 三位英文大写 6位数字
 */

if (!function_exists('GetRandConvertCode')) {
    function GetRandConvertCode()
    {
        $code = [
            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
            'X', 'Y', 'Z'
        ];
        $osn = $code[rand(0, 23)] . $code[rand(0, 23)] . $code[rand(0, 23)] .
            strtoupper(date('m') . date('d') . substr(microtime(), 2, 2));
        return $osn;
    }
}
if (!function_exists('authcode_format')) {
    function authcode_format($result)
    {
        global $_P;
        if (DEVNAME != 'yxdevname' && $_P['do'] != 'SaveLog' && $_P['do'] != 'wUpload') {
            $rand_key = md5(getMillisecond());
            $key = md5($_P['softname'] . $_P['softkey'] . date('md') . $rand_key);
            for ($i = 0; $i < 10; $i++) {
                $encode_txt = authcode2($result, 'ENCODE', $key, 0);
                $decode_txt = authcode2($encode_txt, 'DECODE', $key, 0);
                if (md5($decode_txt) === md5($result)) {
                    //前32位为有无Softname判断mdY为有Ymd没有,中间32位为数据MD5,后32位为随机key;
                    $pdata = md5(date("mdY")) . md5($encode_txt) . $rand_key . $encode_txt;
                    $result = json_encode(array(
                        'pdata' => $pdata
                    ));
                    break;
                }
            }
        }
        return $result;
    }
}
//非常给力的authcode加密函数,Discuz!经典代码(带详解)
//函数authcode($string, $operation, $key, $expiry)中的$string：字符串，明文或密文；$operation：DECODE表示解密，其它表示加密；$key：密匙；$expiry：密文有效期。
if (!function_exists('authcode2')) {
    function authcode2($string, $operation = 'DECODE', $key = 'yixuan', $expiry = 0)
    {
        if ($operation == 'ENCODE') {
            $string = urlencode($string);
        }
        if ($operation == 'DECODE') {
            $md5 = substr($string, 0, 16) . substr($string, -16);
            $string = substr($string, 16, strlen($string) - 32);
            if ($md5 != md5($string)) {
                return;
            }
        }

        // 动态密匙长度，相同的明文会生成不同密文就是依靠动态密匙
        $ckey_length = 5;

        // 密匙
        $key = md5($key ? $key : $GLOBALS['discuz_auth_key']);

        // 密匙a会参与加解密
        $keya = md5(substr($key, 0, 16));
        // 密匙b会用来做数据完整性验证
        $keyb = md5(substr($key, 16, 16));
        // 密匙c用于变化生成的密文
        $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length) : substr(md5(microtime()), -$ckey_length)) : '';
        // 参与运算的密匙
        $cryptkey = $keya . md5($keya . $keyc);
        $key_length = strlen($cryptkey);
        // 明文，前10位用来保存时间戳，解密时验证数据有效性，10到26位用来保存$keyb(密匙b)，
        //解密时会通过这个密匙验证数据完整性
        // 如果是解码的话，会从第$ckey_length位开始，因为密文前$ckey_length位保存 动态密匙，以保证解密正确
        $string = $operation == 'DECODE' ? utf8_decode(base64_decode(substr($string, $ckey_length))) : sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $keyb), 0, 16) . $string;
        $string_length = strlen($string);
        $result = '';
        $box = range(0, 229);
        $rndkey = array();
        // 产生密匙簿
        for ($i = 0; $i <= 229; $i++) {
            $rndkey[$i] = ord($cryptkey[$i % $key_length]);
        }
        // 用固定的算法，打乱密匙簿，增加随机性，好像很复杂，实际上对并不会增加密文的强度
        for ($j = $i = 0; $i < 230; $i++) {
            $j = ($j + $box[$i] + $rndkey[$i]) % 230;
            $tmp = $box[$i];
            $box[$i] = $box[$j];
            $box[$j] = $tmp;
        }
        // 核心加解密部分
        for ($a = $j = $i = 0; $i < $string_length; $i++) {
            $a = ($a + 1) % 230;
            $j = ($j + $box[$a]) % 230;
            $tmp = $box[$a];
            $box[$a] = $box[$j];
            $box[$j] = $tmp;
            // 从密匙簿得出密匙进行异或，再转成字符
            $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 230]));
        }
        if ($operation == 'DECODE') {
            // 验证数据有效性，请看未加密明文的格式
            if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) {
                return urldecode(substr($result, 26));
            } else {
                return '';
            }
        } else {
            // 把动态密匙保存在密文里，这也是为什么同样的明文，生产不同密文后能解密的原因
            // 因为加密后的密文可能是一些特殊字符，复制过程可能会丢失，所以用base64编码
            $result = $keyc . str_replace('=', '', base64_encode(utf8_encode($result)));
            $key = md5($result);
            return substr($key, 0, 16) . $result . substr($key, 16, 16);
        }
    }
}

/**
 * Desc:易宣数据json返回方法
 * Author: yixuan
 * Time: 2016/5/18 18:11
 * @param $code
 * @param $msg
 * @param $data
 * @param $is_json
 */
if (!function_exists('return_json')) {
    function return_json($error = 0, $msg = '', $data = [], $type = '')
    {
        global $_G;
        if (!empty($data)) {
            filterEmptyData($data);
        }
        $type = in_array($type, array('success', 'error', 'info', 'warning')) ? $type : 'info';
        $result = json_encode(['error' => $error, 'msg' => $msg, 'data' => $data, 'type' => $type]);
        if ($_G['app_web_wxapp'] == 'wxapp') {
            $result = authcode_format($result);
        }
        exit($result);
    }
}


if (!function_exists('writelogcz')) {
    function writelogcz($system, $themeid, $type, $difftxt, $username)
    {
        global $_G;
        $data['uniacid'] = $_G['mpid'];
        $data['themeid'] = $themeid;
        $data['type'] = $type;
        $data['desc'] = '【' . SOFT_VERSION . '】' . "<span style=\"color: #d9534f\">" . $difftxt . "</span>";
        $data['user'] = $username;
        $data['ip'] = $_G['clientip'];
        $data['addtime'] = TIMESTAMP;
        $data['url'] = $_G['url_full'];
        if ($type == '导出数据') {
            $data2 = $data;
            $data2['software'] = MODULE_NAME;
            $data2['desc'] = $difftxt;
            if ($_G['isfounder']) {
                $data2['shenfen'] = 1;
            } else {
                $data2['shenfen'] = 0;
            }

            $banklist = \app\model\Poster::Getbanklist($system, 'savelog', $data2);
            if (!empty($banklist) && $banklist['error'] == 0) {
                $r = db_insert(t_log, $data);
            } else {
                $r = $banklist;
            }
        } else {
            $r = db_insert(t_log, $data);
        }
        return $r;
    }
}
if (!function_exists('writelog')) {
    function writelog($themeid, $type, $old_data, $new_data, $username, $url = '')
    {
        global $_G;
        $tuwen_diff = false;
        if (empty($old_data)) {
            $diff = $new_data;
        } else {
            $diff = array_diff_assoc($old_data, $new_data);
            $diff = array_merge($diff, array_diff_key($new_data, $old_data));
        }

        $keyname = getKeynameArray();
        $valuename = getValueArray();
        if (!empty($new_data['content'])) { //如果是$config则执行；
            $data_array = ['addressprobability', 'addressstock', 'address_status', 'addressprice', 'addressimg', 'addresslinkimg', 'addressoptions', 'options', 'gudingoptions', 'form2', 'form3', 'tuan_tips', 'presale'];
            foreach ($data_array as $index => $key) {
                if (!empty($new_data[$key])) {
                    if (empty($old_data[$key])) {
                        $temp_diff = $new_data[$key];
                    } else {
                        $temp_diff = array_diff_assoc($old_data[$key], $new_data[$key]);
                    }
                    if (!empty($temp_diff)) {
                        foreach ($temp_diff as $key_temp => $row_temp) {
                            if (in_array($key, ['addressprobability', 'addressstock', 'address_status', 'addressprice', 'addressimg'])) {
                                $addressoptions = $new_data['addressoptions'][$key_temp];
                            } else {
                                $addressoptions = "";
                            }

                            if (!empty($keyname[$key])) {
                                $showname = $keyname[$key];
                            } else {
                                $showname = $key;
                            }
                            if (!empty($addressoptions)) {
                                if (!empty($difftxt)) {
                                    $difftxt .= "</br>";
                                }
                                $old_data2 = is_array($old_data[$key][$key_temp]) ? json_encode($old_data[$key][$key_temp]) : $old_data[$key][$key_temp];
                                $new_data2 = is_array($new_data[$key][$key_temp]) ? json_encode($new_data[$key][$key_temp]) : $new_data[$key][$key_temp];
                                $difftxt .= "<span style=\"color: #d9534f\">" . $addressoptions . $showname . "[" . $key_temp . "]</span> 原:<span style=\"color: #5cc0de\">" . $old_data2 . "</span>  改为: <span style=\"color: #52af52\">" . $new_data2 . "</span>";
                            }

                        }
                    }
                }
            }
            $difftxt_arr = $difftxt;
        }
        $difftxt = "";
        if (!empty($diff)) {
            foreach ($diff as $key => $row) {
                if (!empty($difftxt)) {
                    $difftxt .= "</br>";
                }
                if ($key == 'content') {
                    $difftxt .= "<span style=\"color: #d9534f\">图文更新</span>";
                    $tuwen_diff = true;
                } elseif ($key == 'maxcount' || $key == 'scansum' || $key == 'forward' || $key == 'commcount' || $key == 'apiclient_cert' || $key == 'apiclient_key_file') {
                    //忽略
                } elseif ($key == 'admintime' || $key == 'begintime' || $key == 'endtime' || $key == 'zhuandanbegintime' || $key == 'zhuandanendtime') {
                    //时间
                    $difftxt .= "<span style=\"color: #d9534f\">" . $keyname[$key] . "</span> 原:<span style=\"color: #5cc0de\">" . date('Y-m-d H:i:s', $old_data[$key]) . "</span>  改为:<span style=\"color: #52af52\">" . date('Y-m-d H:i:s', $new_data[$key]) . "</span>";
                } else {
                    if (valuename($key, $new_data[$key], $valuename)) {
                        $difftxt .= "<span style=\"color: #d9534f\">" . $keyname[$key] . "</span><span style=\"color: #f0ac0a\">" . $key . "</span> 原:<span style=\"color: #5cc0de\">" . valuename($key, $old_data[$key], $valuename) . "</span><span style=\"color: #f0ac0a\">" . $old_data[$key] . "</span>  改为:<span style=\"color: #52af52\">" . valuename($key, $new_data[$key], $valuename) . "</span><span style=\"color: #f0ac0a\">" . $new_data[$key] . "</span>";
                    } else {
                        $difftxt .= "<span style=\"color: #d9534f\">" . $keyname[$key] . "</span><span style=\"color: #f0ac0a\">" . $key . "</span> 原:<span style=\"color: #5cc0de\">" . $old_data[$key] . "</span>  改为:<span style=\"color: #52af52\">" . $new_data[$key] . "</span>";
                    }
                }
            }
        }
        if (!empty($difftxt_arr)) {
            if (!empty($difftxt)) {
                $difftxt .= "</br>";
            }
            $difftxt .= $difftxt_arr;
        }

        if (!empty($difftxt)) {
            //将现有配置及差异存入表中
            if ($type == '活动编辑补款' || $type == '活动编辑theme' || $type == '活动编辑' || $type == '系统编辑') {
                $Condition = array('module_name' => MODULE_NAME);
                $Condition['themeid'] = $themeid;
                $module = db_get('yx_sys_modules', $Condition);
                $theme_key = [`uniacid`, `title`, `desc`, `img`, `addimg`, `addimgxcx`, `headimg`, `keyword`, `mobile`, `begintime`, `endtime`, `status`, `mobileset`, `isautorefund`, `jubf`, `qrimg_addworker`, `viewbilltime`];
                $theme = array();
                $theme_temp = json_decode($module['theme'], true);
                foreach ($theme_key as $key) {
                    $theme[$key] = $theme_temp[$key];
                }
                $all_data = array(
                    'system' => json_decode($module['system'], true),
                    'theme' => $theme,
                    'config' => json_decode($module['config'], true),
                    'diff' => $diff,
                );

                if ($tuwen_diff) {
                    $all_data['tuwen'] = $old_data['content'];
                }
                if ($type == '活动编辑theme') {
                    $all_data['table'] = 'theme';
                    $type = '活动编辑';
                } elseif ($type == '活动编辑') {
                    $all_data['table'] = 'config';
                } elseif ($type == '活动编辑补款') {
                    $all_data['table'] = 'config';
                } elseif ($type == '系统编辑') {
                    $all_data['table'] = 'system';
                }

                $data['tuwen'] = serialize($all_data);
            }
            if (empty($url)) {
                $url = $_G['url_full'];
            } elseif (strpos($url, '还原') !== false) {
                $type = '还原配置';
            }
            $data['uniacid'] = $_G['mpid'];
            $data['themeid'] = $themeid;
            $data['type'] = $type;
            $data['desc'] = '【' . SOFT_VERSION . '】' . $difftxt;
            $data['user'] = $username;
            $data['ip'] = $_G['clientip'];
            $data['addtime'] = TIMESTAMP;
            $data['url'] = $url;
            db_insert(t_log, $data);
        }
    }
}
if (!function_exists('wxapp_result')) {
    //插件化下的返回方法
    function wxapp_result($error = 0, $msg = '', $data = null)
    {
        global $_P;
        if (!is_array($data)) {
            $data = [];
        }
        $result = json_encode(['errno' => $error, 'message' => $msg, 'data' => $data]);
        $result = authcode_format($result);
        exit($result);
    }
}
if (!function_exists('filter_url')) {
    //插件化下的返回方法
    function filter_url($params)
    {
        global $_G;
        if (empty($params)) {
            return '';
        }
        $query_arr = array();
        $parse = parse_url($_G['url_full']);
        if (!empty($parse['query'])) {
            $query = $parse['query'];
            parse_str($query, $query_arr);
        }
        $params = explode(',', $params);
        foreach ($params as $val) {
            if (!empty($val)) {
                $data = explode(':', $val);
                $query_arr[$data[0]] = trim($data[1]);
            }
        }
        $query_arr['page'] = 1;
        $query = http_build_query($query_arr);
        return './index.php?' . $query;
    }
}

if (!function_exists('show_json')) {
    function show_json($status = 1, $return = null)
    {
        $ret = array(
            'status' => $status,
        );

        $ret['result'] = $return;

        die(json_encode($ret));
    }
}

////返回格式化
//if (!function_exists('show')) {
//    function show($code, $msg = '', $data = [])
//    {
//        $msgList = getCodeMsgList($code);
//        if (!$msg || $msg == 'wxapp') {
//            $has_code_msg = array_key_exists($code, $msgList);
//            $msg = $has_code_msg ? $msgList[$code] : '发生了意外';
//        }
//        if ($msg == 'wxapp') {
//            if ($code == 200) {
//                $code = 0;
//            } else {
//                $code = 1;
//            }
//        }
//        return json_encode(['code' => $code, 'msg' => $msg, 'data' => $data]);
//    }
//}
//if (!function_exists('miniShow')) {
//    //微信小程序专用
//    function miniShow($code, $msg = 'wxapp', $data = [])
//    {
//        return show($code, 'wxapp', $data);
//    }
//}
//if (!function_exists('modelShow')) {
//    //model通用化返回
//    function modelShow($code, $msg = '', $data = [])
//    {
//        $msgList = getCodeMsgList($code);
//
//        if (empty($msg) && array_key_exists($code, $msgList)) {
//            $msg = $msgList[$code];
//        }
//        if (empty($msg) && !array_key_exists($code, $msgList)) {
//            $msg = '发生了意外';
//        }
//        return ['code' => $code, 'msg' => $msg, 'data' => $data];
//    }
//}
//if (!function_exists('getCodeMsgList')) {
////返回信息状态码对应状态信息
//    function getCodeMsgList()
//    {
//        $list = [
//            200 => '操作成功',
//            30000 => '操作失败',
//            30001 => '到达操作数量上限',
//            40000 => '发生了意外',
//            40001 => '参数缺失',
//            40002 => '活动入口不正确',
//            40003 => '活动未设置配置信息',
//            40010 => '抽奖次数不足，无法抽奖',
//            40011 => '抽奖次数达到上限',
//            40012 => '今日抽奖次数达到上限',
//            40020 => '积分不足，无法兑换礼品',
//            40029 => '开启了中奖后领取动作，必须设置次数',
//            40030 => '抽奖活动未开启',
//            40031 => '抽奖活动未开始',
//            40032 => '抽奖活动已结束',
//            40040 => '积分活动未开启',
//            40041 => '积分活动未开始',
//            40042 => '积分活动已结束',
//            40050 => '获取群二维码失败',
//            40060 => '砍价配置-价格设置不正确',//后台砍价参数检测
//            40061 => '砍价配置-商品限购不合法',
//            40062 => '砍价实例不存在',
//            40063 => '拼团未开启',
//            40064 => '活动未开始',
//            40065 => '活动已结束',
//            40066 => '砍价时间已到',
//            40067 => '好友砍价已完成',
//            40068 => '您已经帮好友砍价了',
//            40069 => '达到好友帮砍上限',
//            40070 => '砍价功能未开启',
//            40071 => '好友帮砍设置',
//            40072 => '后台砍价黄金宝刀未开启',
//            40073 => '后台分享砍价未开启',
//            40074 => '后台砍价翻倍未开启',
//            40075 => '黄金宝刀已使用',
//            40076 => '分享微信群已使用',
//            40077 => '分享金额翻倍已使用',
//            40078 => '无操作权限',
//            40079 => '活动暂停',
//            40080 => '抽奖总开关',
//            50000 => '非法请求',
//            60000 => '员工无法参与游戏'
//        ];
//        return $list;
//    }
//}
//if (!function_exists('getReceiveTodoAction')) {
////获取奖项的动作
//    function getReceiveTodoAction()
//    {
//        $list = [
//            0 => '无',
////        1=>'用户信息登记',
//            2 => '分享朋友圈',
//            3 => '邀请好友',
//            4 => '分享微信群',
//        ];
//        return $list;
//    }
//}
//if (!function_exists('getShareReceiveCode')) {
////获取执行操作的key
//    function getShareReceiveCode($code = '')
//    {
//        $key = 0;
//        if ($code == 'share_moments') {
//            $key = 2;
//        }
//        if ($code == 'share_qun') {
//            $key = 4;
//        }
//        if ($code == 'new_friend') {
//            $key = 3;
//        }
//        return $key;
//    }
//}
//if (!function_exists('getAddRecordTypeList')) {
////获得抽奖机会的来源
//    function getAddRecordTypeList()
//    {
//        $list = [
//            1 => '系统默认',
//            2 => '通过报名获得',
//            3 => '通过转发朋友圈获得',
//            4 => '通过分享链接,好友下单获得'
//        ];
//        return $list;
//    }
//}
//if (!function_exists('getCheckLotteryOrPoints')) {
////获取抽奖状态 type='lottery' 1可以抽奖 2未开启抽奖 3抽奖时间未到达 4抽奖结束 5达到抽奖机会上限
////查询积分是否开启 type='points'  1可以使用积分 2未开启积分 3积分活动未到时间 4积分活动已过期
//    function getCheckLotteryOrPoints($type, $config, $system)
//    {
//        $now_time = time();
//        if ($type == 'lottery') {
//            $isopen = $system['islottery'];
//            $begintime = $config['lotterybegintime'];
//            $endtime = $config['lotteryendtime'];
//        }
//        if ($type == 'points') {
//            $isopen = $system['ispoints'];
//            $begintime = $config['pointsbegintime'];
//            $endtime = $config['pointsendtime'];
//
//        }
//        if (!$isopen) {
//            return 2;
//        }
//        if ($now_time < $begintime) {
//            return 3;
//        }
//        if ($now_time > $endtime) {
//            return 4;
//        }
//        return 1;
//
//    }
//}
//if (!function_exists('getAddPointsOpList')) {
////获取增加积分的操作列表
//    function getAddPointsOpList()
//    {
//        $list = [
//            0 => '请选择',
//            1 => '分享朋友圈',
//            2 => '分享到微信群',
//            3 => '提前霸王抢购',
//            4 => '好友到访',
//            5 => '好友抢购'
//        ];
//        return $list;
//    }
//}
//if (!function_exists('checkPointsCanUsed')) {
////查询积分是否开启 1可以使用积分 2未开启积分 3积分活动未到时间 4积分活动已过期
//    function checkPointsCanUsed($config, $system)
//    {
//        $ispoints = $system['ispoints'];
//        $pointsbegintime = $config['pointsbegintime'];
//        $pointsendtime = $config['pointsendtime'];
//        $now_time = time();
//        if (!$ispoints) {
//            return 2;
//        }
//        if ($now_time < $pointsbegintime) {
//            return 3;
//        }
//        if ($now_time > $pointsendtime) {
//            return 4;
//        }
//        return 1;
//    }
//}
//if (!function_exists('getPointsRulesList')) {
////获取 增加积分的列表 获得对应的k-v
//    function getPointsRulesList($type = 'all', $config = [], $no_limit = false, $tips = '', $remain = 0, $today_flag = 0)
//    {
//        global $_G, $_P;
//        $data = [];
//        $list = [
//            'pointsquan' => '分享到朋友圈',
//            'pointsqun' => '分享到微信群',
//            'pointsview' => '好友到访',
//            'pointsselfbw' => '霸王抢',
//            'pointsfriendzc' => '好友抢购'
//        ];
//        if ($type == 'all' || !$type) {
//            $data = $list;
//        } else {
//            if (array_key_exists($type, $list)) {
//                $today_limit = false;
//                if ($type == 'pointsquan') {
//                    if ($today_flag >= 1) {
//                        $today_limit = true;
//                    }
//                }
//                $getPointsStatusAndMsg = getPointsStatus($config, $no_limit, $remain, $today_limit);
//                $data = [
//                    'key' => $type,
//                    'title' => $list[$type],
//                    'add_points' => $config[$type],
//                    'no_limit' => $no_limit,
//                    'remain' => $remain,
//                    'today_limit' => $today_limit,
//                    'op_status' => $getPointsStatusAndMsg['op_status'],
//                    'op_msg' => $getPointsStatusAndMsg['op_msg'],
//                    'tips' => $tips
//                ];
//
//                $now_time = time();
//                if ($type == 'pointsfriendzc' && $config['first_buy_begintime'] <= $now_time && $now_time < $config['first_buy_endtime']) {
//                    $data['title'] = '好友霸王抢';
//                    $data['add_points'] = $config['pointsfriendbw'];
//                }
//                if ($type == 'pointsselfbw' && ($config['first_buy_begintime'] > $now_time || $now_time > $config['first_buy_endtime'])) {
//                    $data['title'] = '下单抢购';
//                    $data['add_points'] = $config['pointsselfzc'];
//                }
//                if ($type == 'pointsselfbw') {
//                    $themyrecord = Record::getLastGroupByUid($_G['member']['uid'], $_P['themeid']);
//                    if (!empty($themyrecord)) {
//                        $data['op_msg'] = '已完成';
//                        $data['op_status'] = 2;
//                    }
//                }
//
//            }
//        }
//        return $data;
//    }
//}
//if (!function_exists('substr_cut_username')) {
////用户姓名保留两边 中间*
//    function substr_cut_username($user_name)
//    {
//        $strlen = mb_strlen($user_name, 'utf-8');
//        if ($strlen < 2) {
//            return '*' . $user_name;
//        } else {
//            //mb_substr — 获取字符串的部分
//            $firstStr = mb_substr($user_name, 0, 1, 'utf-8');
//            $lastStr = mb_substr($user_name, -1, 1, 'utf-8');
//            //str_repeat — 重复一个字符串
//            return $strlen == 2 ? $firstStr . str_repeat('*', mb_strlen($user_name, 'utf-8') - 1) : $firstStr . "*" . $lastStr;
//        }
//    }
//}
//if (!function_exists('substr_cut_mobile')) {
////    手机号脱敏格式化
//    function substr_cut_mobile($mobile)
//    {
//        $firstStr = mb_substr($mobile, 0, 3, 'utf-8');
//        $lastStr = substr($mobile, -4);
//        return $firstStr . '****' . $lastStr;
//    }
//}
//if (!function_exists('randomDate')) {
////获取时间端内的随机时间点
//    function randomDate($begintime, $endtime = "", $is = true)
//    {
//        $begin = $begintime;
//
//        $end = $endtime == "" ? mktime() : $endtime;
//
//        $timestamp = rand($begin, $end);
//
//        return $is ? date("Y-m-d H:i:s", $timestamp) : $timestamp;
//
//    }
//}
//if (!function_exists('getPointsStatus')) {
////获取积分状态 1正常 2未开始 3已结束 4已完成
//    function getPointsStatus($config, $no_limit = false, $remain = 0, $today_limit = false)
//    {
//        $status = 1;
//        $time = time();
//        $begin_time = $config['pointsbegintime'];
//        $end_time = $config['pointsendtime'];
//        if ($begin_time > $time) {
//            $status = 2;
//        }
//        if ($end_time < $time) {
//            $status = 3;
//        }
//        $list = [
//            1 => '去完成',
//            2 => '未开始',
//            3 => '攻略过期',
//            4 => '已完成',
//            5 => '今日完成'
//        ];
//        if ($status == 1) {
//            if (!$no_limit && $remain <= 0) {
//                $status = 4;
//            }
//            if (!$no_limit && $remain != 0 && $today_limit) {
//                $status = 5;
//            }
//        }
//        $response = ['op_status' => $status, 'op_msg' => $list[$status]];
//        return $response;
//    }
//}
//if (!function_exists('getLotteryOrPointsType')) {
////获取抽奖和积分对应的增加类型code
//    function getLotteryOrPointsType($type, $config)
//    {
//        $now_time = time();
//        $l_type = 0;
//        $p_type = '';
//        switch ($type) {
//            case 'self_look':
//                $l_type = 1;
//                break;
//            case 'self_pay':
//                $l_type = 2;
//                if ($now_time >= $config['first_buy_begintime'] && $now_time < $config['first_buy_endtime']) {
//                    //属于自己霸王抢订单
//                    $p_type = 'pointsselfbw';
//                } else {
//                    //属于自己正常订单
//                    $p_type = 'pointsselfzc';
//                }
//                break;
//            case 'friend_look':
//                $l_type = 6;
//                $p_type = 'pointsview';
//                break;
//            case 'friend_pay':
//                $l_type = 4;
//                if ($now_time >= $config['first_buy_begintime'] && $now_time < $config['first_buy_endtime']) {
//                    $p_type = 'pointsfriendbw';
//                } else {
//                    $p_type = 'pointsfriendzc';
//                }
//                break;
//            case 'share_moments':
//                $l_type = 3;
//                $p_type = 'pointsquan';
//                break;
//            case 'share_qun':
//                $p_type = 'pointsqun';
//                break;
//            default:
//                break;
//        }
//        return ['l_type' => $l_type, 'p_type' => $p_type];
//    }
//}
//if (!function_exists('formatSelfPointsFlag')) {
////格式化用户积分记录格式
//    function formatSelfPointsFlag($list)
//    {
//        $new_list = [];
//        $temp_arr = [];
//        $total = count($list);
//        foreach ($list as $k => $val) {
//            if (count($temp_arr) >= 4) {
//                array_push($new_list, $temp_arr);
//                $temp_arr = [];
//                array_push($temp_arr, $val);
//            } else {
//                array_push($temp_arr, $val);
//            }
//            if ($k + 1 == $total) {
//                array_push($new_list, $temp_arr);
//            }
//        }
//        return $new_list;
//    }
//}
//if (!function_exists('getOptionListByType')) {
////获取op_type 操作积分、抽奖
//    function getOptionListByType($op_type)
//    {
//        $is_lottery = false;
//        $is_points = false;
//        switch ($op_type) {
//            case 'self_look':
//                $is_lottery = true;
//                break;
//            case 'self_pay':
//                $is_lottery = $is_points = true;
//                break;
//            case 'friend_look':
//                $is_points = true;
//                break;
//            case 'friend_pay':
//                $is_points = $is_lottery = true;
//                break;
//            case 'share_moments':
//                $is_lottery = $is_points = true;
//                break;
//            case 'share_qun':
//                $is_points = true;
//                break;
//            default:
//                break;
//        }
//        return ['is_lottery' => $is_lottery, 'is_points' => $is_points];
//    }
//}
//if (!function_exists('getOpType')) {
////根据当前op_type 判断操作积分和抽奖
//    function getOpType($op_type)
//    {
//        $response = '';
//        $res = getOptionListByType($op_type);
//        if ($res['is_lottery']) {
//            $response = 'lottery';
//        }
//        if ($res['is_points']) {
//            $response = 'points';
//        }
//        if ($res['is_lottery'] && $res['is_points']) {
//            $response = 'all';
//        }
//        return $response;
//    }
//}
//if (!function_exists('getLtItemTypeList')) {
////获取奖项类型
//    function getLtItemTypeList($key = 0)
//    {
//        $list = [
//            1 => '正常',
//            2 => '未中奖',
//            3 => '必中奖',
//            4 => '分享奖',
//            5 => '助力奖'
//        ];
//        if ($key) {
//            $has_key = array_key_exists($key, $list);
//            $msg = $has_key ? $list[$key] : '发生了意外';
//            return $msg;
//        } else {
//            return $list;
//        }
//    }
//}
//if (!function_exists('getUserRecordKeyMsg')) {
////获取用户中奖记录对应的操作文字说明
//    function getUserRecordKeyMsg($key)
//    {
//        $msg = '';
//        if ($key != 0) {
//            $msg = getReceiveTodoAction()[$key];
//        }
//        return $msg;
//    }
//}
//if (!function_exists('formatUserRecordList')) {
////格式化用户中奖记录
//    function formatUserRecordList($list)
//    {
//        foreach ($list as $k => $val) {
//            $end_str = '';
//            if ($val['receive_key'] == 2) {
//                $end_str = '天';
//            }
//            if ($val['receive_key'] == 3) {
//                $end_str = '次';
//            }
//            if ($val['receive_key'] == 4) {
//                $end_str = '个';
//            }
//            $list[$k]['msg'] = getUserRecordKeyMsg($val['receive_key']) . $val['receive_remain_num'] . $end_str;
//            $list[$k]['msglong'] = '此奖品还需要将小程序' . $list[$k]['msg'] . '才可领取此奖品';
//            $list[$k]['tips'] = '苹果手机需将海报分享至朋友圈';
//            if ($val['receive_remain_num'] == 0) {
//                $list[$k]['msg'] = '待兑换';
//            }
//        }
//        return $list;
//    }
//}
//
//
//if (!function_exists('formatLotteryKoi')) {
////格式化锦鲤卡
//    function formatLotteryKoi($code, $list)
//    {
//        $data = [];
//        $msg = '';
//        foreach ($list as $k => $val) {
//            $data[$val['l_id']] = $val['title'];
//        }
//        if (!$code) {
//            $msg = '未设置';
//        } else {
//            if (array_key_exists($code, $data)) {
//                $msg = $data[$code];
//            }
//        }
//        return $msg;
//    }
//}
//if (!function_exists('formatKoiChanceFrom')) {
////获取
//    function formatKoiChanceFrom($code)
//    {
//        $msg = '';
//        switch ($code) {
//            case 'no_register':
//                $msg = '未报名增加';
//                break;
//            case 'friend_view':
//                $msg = '好友到访增加';
//                break;
//            case 'system':
//                $msg = '机会扣除';
//                break;
//            case 'five_lt':
//                $msg = '五连抽';
//                break;
//            case 'lucky_star':
//                $msg = '幸运星';
//                break;
//            default:
//                break;
//        }
//        return $msg;
//    }
//}
//if (!function_exists('formatKoiFlagStatus')) {
////格式化中奖状态
//    function formatKoiFlagStatus($code)
//    {
//        $msg = '';
//        switch ($code) {
//            case 1:
//                $msg = '已中奖，待兑换';
//                break;
//            case 2:
//                $msg = '已兑换其他奖项，当前奖项失效';
//                break;
//            case 3:
//                $msg = '已兑换';
//                break;
//            case 4:
//                $msg = '已核销';
//                break;
//            default:
//                break;
//        }
//        return $msg;
//    }
//}
//if (!function_exists('formatGameSelect')) {
//    function formatGameSelect($code)
//    {
//        $msg = '';
//        switch ($code) {
//            case 0:
//                $msg = '未选择正确选项';
//                break;
//            case 1:
//                $msg = '选项A';
//                break;
//            case 2:
//                $msg = '选项B';
//                break;
//            case 3:
//                $msg = '选项C';
//                break;
//        }
//        return $msg;
//    }
//}
//if (!function_exists('checkTheme')) {
//    /**
//     * Desc:活动状态检查
//     * User: cbw
//     * Time: 2021/1/7 3:14 下午
//     * @param $system
//     * @param $theme
//     * @return array|string
//     */
//    function checkTheme($theme)
//    {
//        $msg = '';
//        $now_time = time();
//        if ($theme['begintime'] > $now_time) {
//            $msg = modelShow(40064);
//        }
//        if ($now_time > $theme['endtime'] || $theme['status'] == 2) {
//            $msg = modelShow(40065);
//        }
//        if ($theme['status'] == 0) {
//            $msg = modelShow(40079);
//        }
//        return $msg;
//    }
//}
//if (!function_exists('CheckPhoneNumber')) {
////判断手机号格式
//    function CheckPhoneNumber($phone)
//    {
//        if (preg_match("/^1[3456789]{1}\d{9}$/", $phone)) {
//            return true;
//        } else {
//            return false;
//        }
//    }
//}
//if (!function_exists('GetRandConvertCode')) {
////随机产生兑换码 三位英文大写 6位数字
//    function GetRandConvertCode()
//    {
//        $code = [
//            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
//            'X', 'Y', 'Z'
//        ];
//        $osn = $code[rand(0, 23)] . $code[rand(0, 23)] . $code[rand(0, 23)] .
//            strtoupper(date('m') . date('d') . substr(microtime(), 2, 2));
//        return $osn;
//    }
//}
////获取页面底部技术信息
//if (!function_exists('getjishu')) {
//    function getjishu($theme, $system)
//    {
//        if ($theme['yixuanbanquan'] != '1') {
//            if (empty($theme['USERJISHU'])) {
//                $jishu['txt'] = $system['s']['yixuanjishu'];
//                $jishu['mobile'] = $system['s']['yixuanphone'];
//            } else {
//                $jishu['txt'] = html_entity_decode($theme['USERJISHU'], ENT_QUOTES);
//                $jishu['mobile'] = str_replace("tel:", "", $theme['USERURL']);
//            }
//        }
//        return $jishu;
//    }
//}
////
//if (!function_exists('getjubf')) {
//    function getjubf($theme, $system)
//    {
//        $jubf = [];
//        $jubf['title'] = empty($theme['jubf']) ? '' : $theme['jubf'] . '-';
//        $jubf['banquan'] = !empty($theme['USERCOMPANYNAME']) ? $theme['USERCOMPANYNAME'] : $system['s']['companyname'];
//        return $jubf;
//    }
//}
//
//if (!function_exists('dump')) {
//    function dump($var, $echo = true, $label = null, $strict = true)
//    {
//        $label = ($label === null) ? '' : rtrim($label) . ' ';
//        if (!$strict) {
//            if (ini_get('html_errors')) {
//                $output = print_r($var, true);
//                $output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) . "</pre>";
//            } else {
//                $output = $label . print_r($var, true);
//            }
//        } else {
//            ob_start();
//            var_dump($var);
//            $output = ob_get_clean();
//            if (!extension_loaded('xdebug')) {
//                $output = preg_replace("/]=>(s+)/m", "] => ", $output);
//                $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>';
//            }
//        }
//        if ($echo) {
//            echo($output);
//            return null;
//        } else
//            return $output;
//    }
//}
//if (!function_exists('get_rand')) {
//    /*
//     * 经典的概率算法，
//     * $proArr是一个预先设置的数组，
//     * 假设数组为：array(20,30，50)，
//     * 开始是从1,100 这个概率范围内筛选第一个数是否在他的出现概率范围之内，
//     * 如果不在，概率变成100-20=80，
//     * 就相当于去一个箱子里摸东西，
//     * 第一个不是，第二个不是，第三个还不是，那最后一个一定是。
//     * 这样 筛选到最终，总会有一个数满足要求。
//     * 这个算法在大数据量的项目中效率非常棒。
//     */
//    function get_rand($proArr, $prize_arr)
//    {
//        $result = '';
//        //概率数组的总概率
//        $proSum = array_sum($proArr);
//        //概率数组循环
//        foreach ($prize_arr as $key => $proCur) {
//            $randNum = mt_rand(1, $proSum);
//            if ($randNum <= $proCur['yx_gift_maxodds']) {
//                //判断库存
//                if ($proCur['yx_gift_stock'] < 1) {
//                    $result = -1;  //未中奖奖项
//                    break;
//                } else {
//                    $result = $proCur['id'];  //获得奖品的ID
//                    break;
//                }
//            } else {
//                $proSum -= $proCur['yx_gift_maxodds'];
//            }
//        }
////          foreach ($proArr as $key => $proCur) {
////              $randNum = mt_rand(1, $proSum);
////              if ($randNum <= $proCur) {
////                  $result = $key;  //获得奖品的ID
////                  break;
////              } else {
////                  $proSum -= $proCur;
////              }
////          }
//        unset ($proArr);
//        return $result;
//    }
//
//    if (!function_exists('exportExcel')) {
//        function exportExcel($expName, $expCellName, $expTableData)
//        {
//            require_once VENDOR_PATH . '/phpexcel/PHPExcel.php';
//            require_once VENDOR_PATH . '/phpexcel/PHPExcel/IOFactory.php';
//            $expName = iconv('utf-8', 'gb2312', $expName);//文件名称
//            //  $fileName = $expName . gmdate('Y-m-d H:i:s');//or $xlsTitle 文件名称可根据自己情况设定
//            $cellNum = count($expCellName);    //横向个数
//            $dataNum = count($expTableData);   //纵向个数
//
//            $objPHPExcel = new \PHPExcel();
//            $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
////        $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(20);
////        $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(20);
//            for ($i = 0; $i < $cellNum; $i++) {
//                $objPHPExcel->getActiveSheet(0)->getStyle($cellName[$i])->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); //居中
//                $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '1', $expCellName[$i][1]);
//            }
//            //dump($objPHPExcel);exit;
//            for ($i = 0; $i < $dataNum; $i++) {
//                for ($j = 0; $j < $cellNum; $j++) {
//                    $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 2), $expTableData[$i][$expCellName[$j][0]]);
//                    $objPHPExcel->getActiveSheet(0)->setCellValueExplicit($cellName[$j] . ($i + 2), $expTableData[$i][$expCellName[$j][0]], PHPExcel_Cell_DataType::TYPE_STRING);   //设置显示的类型
//                }
//            }
//
////        header('pragma:public');
////        header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName . '.xls"');
////        header("Content-Disposition:attachment;filename=$fileName.xls");
////        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
////        $objWriter->save('php://output');
//            header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
//            header('Content-Disposition: attachment;charset=utf-8;filename="' . $expName . '.xlsx"');
//            header('Cache-Control: max-age=0');
//            $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//            $objWriter->save('php://output');
//            exit;
//        }
//    }
//
//
//}

/**
 * Desc:复制微信请求类
 * User:cbw
 * Email:17854288794@163.com
 * Time: 2023/6/20 11:48
 * @param $url
 * @param $post
 * @return mixed
 */
function AccessTokenrequest($url, $post = array())
{
    if ($post) {
        $headers = array('Content-Type' => 'application/json;charset=UTF-8');
        $response = yxcurl($url, $post, $headers);
    } else {
        $response = yxcurl($url, $post);
    }
    if (empty($response['content'])) {
        $response = json_decode($response, true);
        return ['error' => $response['errcode'], 'msg' => $response['errmsg']];
    }
    $response = json_decode($response['content'], true);
    if (empty($response) || !empty($response['errcode'])) {
        return ['error' => $response['errcode'], 'msg' => $response['errmsg']];
    }
    return $response;
}

//获取accesstoken
function getAccessToken($system, $is_current = false)
{
    global $_G;
    if ($is_current) {
        $appid = $system['appid'];
        $secret = $system['secret'];
    } else {
        $appid = $system['appidxcx'];
        $secret = $system['secretxcx'];
    }
    $cachekey = 'accesstoken_' . $appid;
    $cache = cache_load($cachekey);
    if (!empty($cache) && !empty($cache['token']) && $cache['expire'] > TIMESTAMP) {
        return $cache['token'];
    }
    //判断是否为服务商授权模式
    $acc = [];
    if (!$is_current) {
        $acc = \think\Db::table('yx_sys_platform')->where(['appid' => $appid])->find();
    }
    if ($acc && $acc['isdeposit'] == 1) {
        //服务商授权
        $request_url = "https://oa.yixuan.net/yx99999/2/0/0/index.aspx?do=wxservice&op=AuthorizerAccessToken&authorizer_appid=" . $appid;
        $response = oa_request($request_url);
        if ($response['error'] != 1) {
            return $response;
        }
        $auth_accesstoken = array(
            'token' => $response['data']['authorizer_access_token'],
            'expire' => intval($response['data']['expires_in']),
        );
        cache_write($cachekey, $auth_accesstoken);
        return $auth_accesstoken['token'];
        exit();
    }
    $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$secret}";
    $ch1 = curl_init();
    curl_setopt($ch1, CURLOPT_URL, $url);
    curl_setopt($ch1, CURLOPT_POST, 1);
    curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch1, CURLOPT_POSTFIELDS, '');
    $c = curl_exec($ch1);
    $response = @json_decode($c, true);
    $result = array();
    $result['token'] = $response['access_token'];
    $result['expire'] = TIMESTAMP + $response['expires_in'] - 600;
    cache_write($cachekey, $result);
    return $result['token'];
}

//POST请求，URL自动拼接AccessToken；
function PostByAccessToken($system, $url, $postdata, $is_current = false)
{
    global $_G;
    $appid = $is_current ? $_G ['account'] ['key'] : $system['appidxcx'];
    for ($i = 0; $i <= 3; $i++) {
        $access_token = getAccessToken($system, $is_current);
        $post_url = $url . $access_token;
        $postdata2 = $postdata;
        if (is_array($postdata2)) {
            $postdata2 = json_encode($postdata2);
        }
        $ch1 = curl_init();
        curl_setopt($ch1, CURLOPT_URL, $post_url);
        curl_setopt($ch1, CURLOPT_POST, 1);
        curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch1, CURLOPT_POSTFIELDS, $postdata2); //http_build_query($postdata)
        $res = curl_exec($ch1);
        curl_close($ch1);
        $result = @json_decode($res, true);
        if (!empty($result['errcode'])) {
            $cachekey = 'accesstoken_' . $appid;
            cache_delete($cachekey);
            if ($i == 3) {
                $postdata['url'] = $post_url;
                yxlog($postdata, 'POST请求失败');
            }
        } else {
            break;
        }
    }

    return $res;
}

